| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "*.*.*" | |
| name: release | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build distributions for PyPI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| - name: Install build dependencies | |
| run: python -m pip install build | |
| - name: Build distributions | |
| run: python -m build | |
| - name: Upload distributions | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: certifi-dists | |
| path: dist/ | |
| pypi: | |
| name: Publish to PyPI | |
| runs-on: ubuntu-latest | |
| environment: release | |
| needs: | |
| - build | |
| permissions: | |
| # Used to authenticate to PyPI via OIDC. | |
| id-token: write | |
| steps: | |
| - name: fetch dists | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: certifi-dists | |
| path: dist/ | |
| - name: publish | |
| if: github.event_name == 'push' | |
| uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 | |
| with: | |
| attestations: true |