Packaging: simplify executables names #106
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build 📦 and release 🚀" | |
# Triggers | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- ".github/workflows/builder_releaser.yml" | |
- "builder/**/*" | |
- "dicogis/**/*.py" | |
- "requirements/packaging.txt" | |
tags: | |
- "*" | |
pull_request: | |
branches: | |
- master | |
paths: | |
- ".github/workflows/builder_releaser.yml" | |
- "builder/" | |
- "requirements/packaging.txt" | |
# 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 LTS" | |
runs-on: ubuntu-22.04 | |
env: | |
GDAL_VERSION: 3.8.* | |
steps: | |
- name: Get source code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
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 for command-line version | |
run: | | |
python -O ./builder/pyinstaller_build_ubuntu_cli.py | |
chmod +x dist/DicoGIS-cli.bin | |
- name: Save CLI binary as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: DicoGIS_executable_ubuntu_CLI | |
path: dist/DicoGIS-cli.bin | |
if-no-files-found: error | |
- name: Generates executable for graphical version | |
run: | | |
python -O ./builder/pyinstaller_build_ubuntu_gui.py | |
chmod +x dist/DicoGIS-gui.bin | |
- name: Save it as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: DicoGIS_executable_ubuntu_GUI | |
path: dist/DicoGIS-gui.bin | |
if-no-files-found: error | |
- name: Minimal integration test | |
run: | | |
./dist/DicoGIS-cli.bin --help | |
./dist/DicoGIS-cli.bin --version | |
build-windows: | |
name: "🏠 Windows" | |
runs-on: windows-latest | |
env: | |
GDAL_VERSION: 3.8.4 | |
steps: | |
- name: Get source code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
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/v2024.2.18/GDAL-3.8.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 executable for command-line version | |
run: | | |
python -O ./builder/pyinstaller_build_windows_cli.py | |
- name: Save CLI binary as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: DicoGIS_executable_windows_CLI | |
path: dist/DicoGIS-cli.exe | |
if-no-files-found: error | |
- name: Generates executable for graphical version | |
run: | | |
python -O ./builder/pyinstaller_build_windows_gui.py | |
- name: Save it as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: DicoGIS_executable_windows_GUI | |
path: dist/DicoGIS-gui.exe | |
if-no-files-found: error | |
- name: Minimal integration test | |
run: | | |
./dist/DicoGIS-cli.exe --help | |
./dist/DicoGIS-cli.exe --version | |
release: | |
name: "🚀 GitHub Release" | |
runs-on: ubuntu-latest | |
needs: | |
- build-ubuntu | |
- build-windows | |
permissions: | |
contents: write | |
discussions: write | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Download built package for Linux (Ubuntu) - GUI | |
uses: actions/download-artifact@v4 | |
with: | |
name: DicoGIS_executable_ubuntu_GUI | |
path: builds/ubuntu/gui/ | |
- name: Download built package for Linux (Ubuntu) - CLI | |
uses: actions/download-artifact@v4 | |
with: | |
name: DicoGIS_executable_ubuntu_CLI | |
path: builds/ubuntu/cli/ | |
- name: Download built package for Windows - GUI | |
uses: actions/download-artifact@v4 | |
with: | |
name: DicoGIS_executable_windows_GUI | |
path: builds/windows/gui | |
- name: Download built package for Windows - CLI | |
uses: actions/download-artifact@v4 | |
with: | |
name: DicoGIS_executable_windows_CLI | |
path: builds/windows/cli | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
discussion_category_name: announcements | |
fail_on_unmatched_files: true | |
files: builds/*/*.zip | |
generate_release_notes: true |