Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/conda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Conda

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on: push

jobs:

Update-conda-package-version:

runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true

- name: Set Env variable with project version
run: |
echo "VERSION=$(grep "project(" CMakeLists.txt | grep -E -o -e "[0-9\.]+")" >> $GITHUB_ENV

- name: Print project version
run: |
echo "Project version: $VERSION"

- name: Update conda package version
run: |
sed -i '/version: /c\ version: \"'$VERSION'\"' conda/meta.yaml

- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Change to conda package version
file_pattern: 'conda/meta.yaml'

# build:
# needs: Update-conda-package-version

# runs-on: ubuntu-latest

# defaults:
# run:
# shell: bash -l {0}

# permissions:
# contents: write

# env:
# CONDA_PKG_DIR: ~/conda_pkgs_dir
# GH_TOKEN: ${{ github.token }}

# steps:

# - name: Checkout
# uses: actions/checkout@v4

# - name: Setup conda
# uses: conda-incubator/setup-miniconda@v3
# with:
# use-mamba: true
# python-version: 3.12
# environment-file: conda/conda-env.yaml
# activate-environment: dev-viewshed

# - name: Build library
# run: |
# conda build conda
106 changes: 8 additions & 98 deletions .github/workflows/create_releases.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
name: Prepare Deb Release, Docker Release, Release to PPA
name: Prepare Deb Release, Docker Release

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on:
workflow_run:
Expand Down Expand Up @@ -150,35 +154,11 @@ jobs:

runs-on: ubuntu-latest

needs: Create-deb-file-library

steps:

- name: Checkout
uses: actions/checkout@v4

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: viewshed

- name: Copy viewshed to docker folder
run: |
mkdir docker/install
mv viewshed_*.deb docker/install/

- uses: robinraju/release-downloader@v1.10
with:
repository: "JanCaha/cpp-simplerasters"
latest: true
fileName: "*.deb"
tarBall: false
zipBall: false

- name: Copy simplerasters to docker folder
run: |
mv simplerasters_*.deb docker/install/

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
Expand All @@ -190,91 +170,21 @@ jobs:
run: |
echo "VERSION=$(grep "project(" CMakeLists.txt | grep -E -o -e "[0-9\.]+")" >> $GITHUB_ENV
echo "VERSION=$(grep "project(" CMakeLists.txt | grep -E -o -e "[0-9\.]+")" >> $GITHUB_OUTPUT

- name: Download artifact WHL
uses: actions/download-artifact@v4
with:
name: python-viewshed

- name: Copy Python Viewshed to docker folder
run: |
mv viewshed-*.whl docker/install/


- name: Build and push Docker image version with Python
uses: docker/build-push-action@v4
with:
file: docker/viewshed_install_from_ppa.dockerfile
file: docker/Dockerfile
context: docker/
push: true
tags: "cahik/viewshed:v${{steps.version.outputs.VERSION}}"

- name: Build and push Docker image latest with Python
uses: docker/build-push-action@v4
with:
file: docker/viewshed_install_from_ppa.dockerfile
file: docker/Dockerfile
context: docker/
push: true
tags: cahik/viewshed:latest

Release-to-PPA:

runs-on: ubuntu-latest

needs: Create-deb-file-library

steps:

- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Set env
run: |
echo "VERSION=$(grep "project(" CMakeLists.txt | grep -E -o -e "[0-9\.]+" | head -n 1)" >> $GITHUB_ENV
echo "DEBIAN_VERSION=$(grep "viewshed (" debian/changelog | grep -E -o -e "[0-9\.-]+" | head -n 1)" >> $GITHUB_ENV

- name: Print Version
run: |
echo "-----"
echo "Project Version"
echo ${PACKAGE}
echo ${VERSION}
echo ${DEBIAN_VERSION}
echo "-----"

- name: install build tools
run: |
sudo apt-get update
sudo apt-get install debhelper devscripts dput

- name: import gpg key 55C76CE00DD5C647
run: |
echo "${GPG_PRIVATE_KEY}" | base64 --decode | gpg --batch --quiet --import
echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 55C76CE00DD5C647 --dry-run --sign README.md
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Create tar.gz package
run: |
cd ..
dir
tar -acf "${PACKAGE}"_"${VERSION}".orig.tar.gz cpp-viewshed-library
ls -l

- name: Debuild
run: debuild -S -sa -d
env:
DEBSIGN_PROGRAM: gpg --batch --pinentry-mode loopback
DEBSIGN_KEYID: 55C76CE00DD5C647

- name: Show Files
run: |
cd ..
ls -l

- name: Dput to Repo
run: |
cd ..
dput ppa:jancaha/gis-tools "${PACKAGE}"_"${DEBIAN_VERSION}"_source.changes
65 changes: 51 additions & 14 deletions .github/workflows/test_library.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Tests for Library

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true


on: [push, pull_request]

env:
Expand All @@ -9,7 +14,7 @@ jobs:

Tests-Viewshed-library:

runs-on: ubuntu-latest
runs-on: ubuntu-22.04

env:
DEBIAN_FRONTEND: "noninteractive"
Expand All @@ -30,7 +35,7 @@ jobs:
sudo apt update
sudo apt-get -y install gdal-bin libgdal-dev

- uses: robinraju/release-downloader@v1.8
- uses: robinraju/release-downloader@v1
with:
repository: "JanCaha/cpp-simplerasters"
latest: true
Expand Down Expand Up @@ -97,17 +102,51 @@ jobs:
cmake --build build --config Release --target build_tests
cmake --build build --config Release --target run_tests

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '5.15.2'
host: 'linux'

- name: Clean Build
Tests-Viewshed-library-with-Qt:

runs-on: ubuntu-22.04

env:
DEBIAN_FRONTEND: "noninteractive"
QT_QPA_PLATFORM: "offscreen"
XDG_RUNTIME_DIR: "/tmp"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:

- name: Update and Upgrade
run: |
rm -rf build
mkdir build
sudo apt update
sudo apt install ninja-build doxygen libgtest-dev libgmock-dev clang

- name: Install GDAL
run: |
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt update
sudo apt-get -y install gdal-bin libgdal-dev

- uses: robinraju/release-downloader@v1
with:
repository: "JanCaha/cpp-simplerasters"
latest: true
fileName: "*.deb"
tarBall: false
zipBall: false

- name: Install and remove artifact
run: |
sudo apt install ./simplerasters*.deb
rm simplerasters*

- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Install Qt
run: |
sudo apt install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools

- name: Configure
run: |
cmake \
Expand All @@ -134,6 +173,4 @@ jobs:
- name: Test Install
run: |
cmake --build build --config Release --target all
sudo cmake --build build --config Release --target install


sudo cmake --build build --config Release --target install
37 changes: 37 additions & 0 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package:
name: libviewshed
version: "4.1.0"

source:
path: ..

build:
number: 0
script:
- cmake -B build -S {{SRC_DIR}} -G Ninja -DCMAKE_BUILD_TYPE=Release -DPACK_DEB:bool=off -DBUILD_DOCUMENTATION:bool=off -DBUILD_TESTS:bool=off -DCELL_EVENT_DATA_FLOAT:bool=on -DOUTPUT_RASTER_DATA_FLOAT:bool=on -DNEEDS_QT:bool=off
- cmake --build build --config Release
- cmake --install build --prefix {{PREFIX}}

requirements:
build:
- { { compiler('c') } }
- { { compiler('cxx') } }
host:
- cmake
- ninja
- libgdal
- libsimplerasters
run:
- libgdal
- libsimplerasters

about:
home: https://github.com/JanCaha/cpp-viewshed-library
license: MIT
summary: "C++ Viewshed library based on GDAL and Qt"

extra:
recipe-maintainers:
- JanCaha
channels:
- conda-forge
Loading