fix(ci): wait for and verify Windows Gammu installation #1397
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: Distribution | |
| on: [push, pull_request] | |
| permissions: | |
| contents: read | |
| jobs: | |
| sdist: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: 3.14 | |
| - uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0 | |
| - uses: ./.github/actions/install-gammu | |
| - name: build | |
| run: uv build --sdist | |
| - name: Store the source distribution | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: dist-sdist | |
| path: dist | |
| linux: | |
| strategy: | |
| matrix: | |
| include: | |
| - architecture: x86_64 | |
| runner: ubuntu-24.04 | |
| - architecture: aarch64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1 | |
| env: | |
| CIBW_ARCHS_LINUX: ${{ matrix.architecture }} | |
| - name: Store the Linux wheels | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: dist-linux-${{ matrix.architecture }} | |
| path: wheelhouse | |
| windows: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| python-version: | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| - "3.14" | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: ./.github/actions/install-gammu | |
| - uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0 | |
| - name: build | |
| run: uv build --wheel | |
| - name: Store the binary wheel | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: dist-windows-${{ matrix.python-version }} | |
| path: dist | |
| check: | |
| needs: | |
| - linux | |
| - sdist | |
| - windows | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: '3.14' | |
| - uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0 | |
| with: | |
| version: 0.12.15 | |
| - uses: ./.github/actions/install-gammu | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - run: uvx twine check --strict dist/* | |
| - run: uvx abi3audit dist/*abi3*.whl | |
| - name: Check Linux wheel contents | |
| shell: bash | |
| run: | | |
| test "$(find dist -maxdepth 1 -name '*manylinux*.whl' | wc -l)" -eq 10 | |
| for wheel in dist/*manylinux*.whl; do | |
| uvx auditwheel show "$wheel" | |
| if unzip -Z1 "$wheel" | grep -E '(^|/)[^/]+[.]libs/'; then | |
| echo "Unexpected bundled shared libraries in $wheel" | |
| exit 1 | |
| fi | |
| done | |
| - run: uvx pydistcheck --inspect dist/* | |
| - run: uvx check-wheel-contents dist/*.whl | |
| - run: uvx check-manifest -v | |
| publish: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| # this permission is mandatory for trusted publishing | |
| id-token: write | |
| needs: | |
| - check | |
| - linux | |
| - sdist | |
| - windows | |
| if: startsWith(github.ref, 'refs/tags/') && github.repository == 'gammu/python-gammu' | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Download all the dists | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| path: dist/ | |
| merge-multiple: true | |
| - name: Publish package | |
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
| uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 | |
| release_github: | |
| runs-on: ubuntu-24.04 | |
| name: Create release on GitHub | |
| needs: | |
| - check | |
| - linux | |
| - sdist | |
| - windows | |
| permissions: | |
| contents: write | |
| if: startsWith(github.ref, 'refs/tags/') && github.repository == 'gammu/python-gammu' | |
| steps: | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| path: dist/ | |
| merge-multiple: true | |
| - uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0 | |
| with: | |
| generateReleaseNotes: true | |
| artifacts: dist/* |