Skip to content

bump version 1.0.2 -> 1.0.3 #11

bump version 1.0.2 -> 1.0.3

bump version 1.0.2 -> 1.0.3 #11

name: Package and Release
on:
push:
branches: ["main"]
tags:
- '*'
workflow_dispatch:
permissions:
packages: write
contents: write
jobs:
all:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
include:
- os: windows-latest
artifact_name: geodepot-win
conda_path: C:\Miniconda
conda_exe: C:\Miniconda\Scripts\conda.exe
geodepot_exe: \dist\geodepot\geodepot.exe
- os: ubuntu-latest
artifact_name: geodepot-ubuntu
conda_path: /usr/share/miniconda
conda_exe: conda
geodepot_exe: /dist/geodepot/geodepot
- os: macos-latest
artifact_name: geodepot-macos
conda_path: /Users/runner/miniconda3
conda_exe: conda
geodepot_exe: /dist/geodepot/geodepot
steps:
- uses: actions/checkout@v4
- if: runner.os == 'Windows'
name: Install wget on Windows
run: choco install wget
- uses: extractions/setup-just@v2
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Download test data
run: just download-data
# Install dependencies
- if: runner.os == 'macOS'
name: Install Miniconda on macOS
run: |
mkdir -p $HOME/miniconda3
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o $HOME/miniconda3/miniconda.sh
bash $HOME/miniconda3/miniconda.sh -b -u -p $HOME/miniconda3
rm $HOME/miniconda3/miniconda.sh
$HOME/miniconda3/bin/conda init bash
echo "CONDA=$HOME/miniconda3" >> $GITHUB_ENV
- if: runner.os != 'Windows'
name: Add conda to system path non-Windows
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- if: runner.os == 'Windows'
name: Add conda to system path Windows
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA\Scripts >> $GITHUB_PATH
- name: Cache conda environment
id: cache-conda
uses: actions/cache@v4
with:
path: ${{ matrix.conda_path }}
key: ${{ runner.os }}-conda
- name: Install dependencies
if: steps.cache-conda.outputs.cache-hit != 'true'
run: |
${{ matrix.conda_exe }} install -y --name base --solver=classic conda-forge::conda-libmamba-solver conda-forge::libmamba conda-forge::libmambapy conda-forge::libarchive
${{ matrix.conda_exe }} install -y --name base --solver libmamba --channel conda-forge proj=9.4 click=8.1 requests=2.32 fabric=3.2 gdal=3.9 pdal=2.7 python-pdal=3.4 pyinstaller=6.10 pytest ruff
- name: Re-init conda shell
run: |
${{ matrix.conda_exe }} init --all
- name: Test if fucking pdal didn't fuck up gdal
run: |
python -c 'import osgeo'
# Install and test
- name: Install package
run: |
pip install .
- name: Lint
run: ruff check
- name: Format
run: ruff format --check
- name: Run unit tests
run: pytest
# Package
- if: runner.os == 'Linux'
name: Pyinstaller package Linux
run: |
pyinstaller --name geodepot --onedir --noconfirm --optimize 2 --add-data $CONDA/share/proj:share/proj --collect-all pdal --collect-all osgeo src/geodepot/__main__.py
- if: runner.os == 'macOS'
name: Pyinstaller package macOS
run: |
pyinstaller --name geodepot --onedir --console --noconfirm --optimize 2 --add-data $CONDA/share/proj/proj.db:share/proj/proj.db --collect-all pdal --collect-all osgeo src/geodepot/__main__.py
- if: runner.os == 'Windows'
name: Pyinstaller package Windows
run: |
pyinstaller --name geodepot --onedir --console --noconfirm --optimize 2 --add-data C:/Miniconda/Library/share/proj/proj.db:share/proj/proj.db --collect-all pdal --collect-all osgeo src/geodepot/__main__.py
# Test exe
- name: Test exe
run: |
${{ github.workspace }}${{ matrix.geodepot_exe }} init
${{ github.workspace }}${{ matrix.geodepot_exe }} add wippolder tests/data/sources/wippolder/wippolder.gpkg
${{ github.workspace }}${{ matrix.geodepot_exe }} list
${{ github.workspace }}${{ matrix.geodepot_exe }} show wippolder/wippolder.gpkg
# Create package archive
- if: runner.os == 'Linux'
name: Create package archive Linux
run: |
cd dist
zip -r geodepot-ubuntu.zip geodepot
sha256sum geodepot-ubuntu.zip > geodepot-ubuntu.zip.sha256sum
rm -rf geodepot
- if: runner.os == 'macOS'
name: Create package archive macOS
run: |
cd dist
zip -r geodepot-macos.zip geodepot
shasum -a 256 geodepot-macos.zip > geodepot-macos.zip.sha256sum
rm -rf geodepot
- if: runner.os == 'Windows'
name: Create package archive Windows
run: |
cd dist
7z a geodepot-win.zip geodepot
certUtil -hashfile geodepot-win.zip SHA256 > geodepot-win.zip.sha256sum
rm -r -fo geodepot
- name: List contents
run: |
ls dist
- name: Upload binaries to
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: dist/*
retention-days: 7
- name: Release
uses: softprops/action-gh-release@v2
with:
prerelease: true
repository: 3DGI/geodepot
token: ${{ secrets.GITHUB_TOKEN }}
files: dist/*