Skip to content

Try to fix gdal install #39

Try to fix gdal install

Try to fix gdal install #39

name: "Build πŸ“¦ and release πŸš€"
# Triggers
on:
push:
branches: [master]
paths:
- ".github/workflows/builder_releaser.yml"
- "builder/**/*"
- "dicogis/**/*.py"
tags:
- "*"
# Globals
env:
PROJECT_FOLDER: "dicogis"
PYTHON_VERSION: "3.10"
PYINSTALLER_LOG_LEVEL: "DEBUG"
USE_PATH_FOR_GDAL_PYTHON: yes
# Jobs definition
jobs:
build-ubuntu:
name: "Ubuntu packager πŸ“¦"
runs-on: ubuntu-22.04
env:
GDAL_VERSION: 3.6.*
steps:
- name: Get source code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip"
cache-dependency-path: "requirements/*.txt"
- name: Install GDAL binaries
run: |
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable && sudo apt-get update
sudo apt install gdal-bin=${{ env.GDAL_VERSION }}
sudo apt install libgdal-dev=${{ env.GDAL_VERSION }}
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
gdal-config --version
- name: Install complementary tools
run: |
sudo apt install python3-tk
- name: Install project requirements
run: |
python -m pip install -U pip setuptools wheel
python -m pip install -U -r requirements/base.txt
python -m pip install gdal=="`gdal-config --version`.*"
python -m pip install -e .[gdal]
python -m pip install -U -r requirements/packaging.txt
- name: Generates Executable
run: python -O ./builder/pyinstaller_build_ubuntu.py
- uses: actions/upload-artifact@v3
with:
name: DicoGIS_ubuntu_executable
path: dist/DicoGIS*/
build-windows:
name: "Windows packager πŸ“¦"
runs-on: windows-latest
env:
GDAL_VERSION: 3.6.4
steps:
- name: Get source code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip"
cache-dependency-path: "requirements/*.txt"
- name: Install project requirements
run: |
python -m pip install -U pip setuptools wheel
python -m pip install -U -r requirements/base.txt
python -m pip install -U https://github.com/cgohlke/geospatial-wheels/releases/download/v2023.4.22/GDAL-3.6.4-cp310-cp310-win_amd64.whl
python -m pip install -U -r requirements/packaging.txt
- name: Install project as a package
run: python -m pip install -e .[gdal]
- name: Generates MS Version Info
run: python .\builder\version_info_templater.py
- name: Generates MS Executable
run: python -O .\builder\pyinstaller_build_windows.py
- name: Save it as artifact
uses: actions/upload-artifact@v3
with:
name: DicoGIS_windows_executable
path: dist/DicoGIS*
release:
name: "Release on tag πŸš€"
runs-on: ubuntu-latest
needs: [build-ubuntu, build-windows]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download Ubuntu build
uses: actions/download-artifact@v3
with:
name: DicoGIS_ubuntu_executable
path: builds/ubuntu/
- uses: actions/download-artifact@v3
with:
name: DicoGIS_windows_executable
path: builds/windows/
- name: Create/update release on GitHub
uses: ncipollo/[email protected]
with:
allowUpdates: true
artifacts: "builds/*"
generateReleaseNotes: true
omitNameDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}