| 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@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
| - name: Set up Python | |
| uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.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@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.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@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | |
| with: | |
| name: certifi-dists | |
| path: dist/ | |
| - name: publish | |
| if: github.event_name == 'push' | |
| uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10 |