pre-commit: bump repositories #1138
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: CD | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| tags: | |
| - "[0-9]+.[0-9]+.[0-9]+" | |
| - "[0-9]+.[0-9]+.[0-9]+.post[0-9]+" | |
| release: | |
| types: | |
| - published | |
| concurrency: | |
| group: cd-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| dist: | |
| name: Build distribution | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # to checkout | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: hynek/build-and-inspect-python-package@2abe76da66d0a6a4a227101f9348ee855797cfa5 # v3.0.1 | |
| create-release: | |
| name: Create GitHub Release | |
| needs: [dist] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write # to create release | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Create GitHub Release | |
| run: gh release create "$RELEASE_TAG" --generate-notes | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| RELEASE_TAG: ${{ github.ref_name }} | |
| publish: | |
| name: Publish to PyPI | |
| needs: [dist] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'release' && github.event.action == 'published') | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/build | |
| permissions: | |
| id-token: write # to sign attestation | |
| attestations: write # to create attestation | |
| steps: | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 | |
| with: | |
| name: Packages | |
| path: dist | |
| - name: Generate artifact attestation for sdist and wheel | |
| uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 | |
| with: | |
| subject-path: "dist/build-*" | |
| - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 |