Fix Database Installation Path and Prevent Duplicate Database #191
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*' | |
| env: | |
| VERSION: 0.5.0 | |
| jobs: | |
| bindings: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| variant: | |
| # https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json | |
| - {runner: macos-13, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.9' } | |
| - {runner: macos-13, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.10' } | |
| - {runner: macos-13, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.11' } | |
| - {runner: macos-13, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.12' } | |
| - {runner: macos-13, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.13' } | |
| - {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.9' } | |
| - {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.10' } | |
| - {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.11' } | |
| - {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.12' } | |
| - {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.13' } | |
| - {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.9' } | |
| - {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.10' } | |
| - {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.11' } | |
| - {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.12' } | |
| - {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.13' } | |
| - {runner: ubuntu-24.04-arm, qt-os: linux_arm64, arch: arm64, py-arch: arm64, qt-compiler: gcc_arm64, config: RelWithDebInfo, py-version: '3.13' } | |
| - {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.9' } | |
| - {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.10' } | |
| - {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.11' } | |
| - {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.12' } | |
| - {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.13' } | |
| runs-on: ${{ matrix.variant.runner }} | |
| name: python${{ matrix.variant.py-version }} / ${{ matrix.variant.runner }} / ${{ matrix.variant.config }} | |
| env: | |
| CMAKE_FLAGS: "" | |
| QT_VERSION: 6.7.3 # arm64 support in aqt appears from >= 6.7.0 - and almalinux ships an old libc incompat with >= 6.8.x | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.variant.py-version }} | |
| architecture: ${{ matrix.variant.py-arch }} | |
| - name: Environment Setup (Windows) | |
| if: startsWith(matrix.variant.runner, 'windows-') | |
| run: | | |
| Import-Module .\.github\Invoke-VisualStudio.ps1 | |
| Invoke-VisualStudio2019${{ matrix.variant.arch }} | |
| - name: Environment Setup (Linux) | |
| if: startsWith(matrix.variant.runner, 'ubuntu-') | |
| run: | | |
| sudo apt-get -y update | |
| sudo apt install -y g++ ninja-build clang | |
| echo CC=clang >> $GITHUB_ENV | |
| echo CXX=clang++ >> $GITHUB_ENV | |
| - name: Environment Setup (macOS) | |
| if: startsWith(matrix.variant.runner, 'macos-') | |
| run: | | |
| echo CC=clang >> $GITHUB_ENV | |
| echo CXX=clang++ >> $GITHUB_ENV | |
| - name: Cache Artifacts | |
| id: cache-artifacts | |
| uses: actions/cache@v4 | |
| with: | |
| path: build/${{ env.QT_VERSION }} | |
| key: aqt-install-${{ matrix.variant.runner }}-${{ matrix.variant.arch }}-${{ env.QT_VERSION }}-${{ matrix.variant.qt-compiler }} | |
| - name: Setup Qt (Windows) | |
| if: steps.cache-artifacts.outputs.cache-hit != 'true' && startsWith(matrix.variant.runner, 'windows-') | |
| run: | | |
| python -m pip install aqtinstall --user --upgrade | |
| python -m aqt install-qt -O build/ ${{ matrix.variant.qt-os }} desktop ${{ env.QT_VERSION }} win64_${{ matrix.variant.qt-compiler }} | |
| - name: Setup Qt (macOS) | |
| if: steps.cache-artifacts.outputs.cache-hit != 'true' && startsWith(matrix.variant.runner, 'macos-') | |
| run: | | |
| python -m pip install aqtinstall --user --upgrade | |
| python -m aqt install-qt -O build/ ${{ matrix.variant.qt-os }} desktop ${{ env.QT_VERSION }} ${{ matrix.variant.qt-compiler }} | |
| - name: Setup Qt (Linux) | |
| if: steps.cache-artifacts.outputs.cache-hit != 'true' && startsWith(matrix.variant.runner, 'ubuntu-') | |
| run: | | |
| python -m pip install aqtinstall --user --upgrade | |
| python -m aqt install-qt -O build/ ${{ matrix.variant.qt-os }} desktop ${{ env.QT_VERSION }} linux_${{ matrix.variant.qt-compiler }} | |
| - name: Python installation | |
| run: | | |
| python -m pip install '.[tests]' -U --user | |
| - name: Test | |
| if: startsWith(matrix.variant.runner, 'macos-') == false | |
| run: | | |
| python -m pytest -v python/tests | |
| - name: Build wheels (Linux arm64) | |
| if: matrix.variant.runner == 'ubuntu-24.04-arm' && matrix.variant.py-version == '3.13' | |
| run: | | |
| python -m pip uninstall --quiet --yes die-python | |
| rm -fr -- build/cp* | |
| python -m pip install cibuildwheel==2.23.0 | |
| python -m cibuildwheel --output-dir wheelhouse --archs aarch64 | |
| - name: Build wheels (Linux x64) | |
| if: matrix.variant.runner == 'ubuntu-24.04' && matrix.variant.py-version == '3.13' | |
| run: | | |
| python -m pip uninstall --quiet --yes die-python | |
| rm -fr -- build/cp* | |
| python -m pip install cibuildwheel==2.23.0 | |
| python -m cibuildwheel --output-dir wheelhouse/ --archs x86_64 | |
| - name: Build wheels (Others) | |
| if: startsWith(matrix.variant.runner, 'ubuntu-') == false | |
| run: | | |
| mkdir wheelhouse | |
| python -m pip wheel . --wheel-dir wheel/ --progress-bar on | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: die-python-py${{ matrix.variant.py-version }}-${{ matrix.variant.runner }}.${{ matrix.variant.config }} | |
| path: | | |
| wheelhouse/die_python-*.whl | |
| wheel/die_python-*.whl | |
| retention-days: 1 | |
| publish: | |
| needs: bindings | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| variant: | |
| # https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json | |
| - {runner: macos-13, config: Release, py-version: '3.9' } | |
| - {runner: macos-13, config: Release, py-version: '3.10' } | |
| - {runner: macos-13, config: Release, py-version: '3.11' } | |
| - {runner: macos-13, config: Release, py-version: '3.12' } | |
| - {runner: macos-13, config: Release, py-version: '3.13' } | |
| # - {runner: ubuntu-24.04, config: RelWithDebInfo, py-version: '3.12' } | |
| - {runner: ubuntu-24.04, config: RelWithDebInfo, py-version: '3.13' } | |
| - {runner: ubuntu-24.04-arm, config: RelWithDebInfo, py-version: '3.13' } | |
| - {runner: windows-2022, config: RelWithDebInfo, py-version: '3.9' } | |
| - {runner: windows-2022, config: RelWithDebInfo, py-version: '3.10' } | |
| - {runner: windows-2022, config: RelWithDebInfo, py-version: '3.11' } | |
| - {runner: windows-2022, config: RelWithDebInfo, py-version: '3.12' } | |
| - {runner: windows-2022, config: RelWithDebInfo, py-version: '3.13' } | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| name: PyPI upload of ${{ matrix.variant.runner }}/${{ matrix.variant.config }}/py${{ matrix.variant.py-version }} | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/die-python | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download Wheel ${{ matrix.variant.runner }}/${{ matrix.variant.py-version }}/${{ matrix.variant.config }} | |
| uses: actions/download-artifact@v4 | |
| id: download_wheels | |
| with: | |
| name: die-python-py${{ matrix.variant.py-version }}-${{ matrix.variant.runner }}.${{ matrix.variant.config }} | |
| path: . | |
| - name: Install uv | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| - name: Publish package | |
| run: | | |
| uv publish |