name: Release on: push: branches: - main pull_request: workflow_dispatch: # allow manual runs on branches without a PR release: types: - published concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true permissions: {} jobs: dist: name: Build dist runs-on: ubuntu-latest permissions: contents: read steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 # required for setuptools_scm to find tags persist-credentials: false - name: Build dist # This action builds the distributions and uploads them as an artifact named "Packages", # which is later downloaded in the `publish` job via actions/download-artifact. uses: hynek/build-and-inspect-python-package@fe0a0fb1925ca263d076ca4f2c13e93a6e92a33e # v2.17.0 publish: name: Publish to PyPI needs: [dist] runs-on: ubuntu-latest if: github.event_name == 'release' && github.event.action == 'published' environment: name: pypi url: https://pypi.org/p/auditwheel permissions: attestations: write # for attestation generation id-token: write # for trusted publishing steps: - name: Download dist artefacts uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: Packages path: dist - name: Generate artifact attestation for sdist and wheel uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0 with: subject-path: "dist/auditwheel-*" - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 with: attestations: true