diff --git a/.github/workflows/ci.yml b/.github/workflows/ci-cd.yml similarity index 91% rename from .github/workflows/ci.yml rename to .github/workflows/ci-cd.yml index 27a2e63215e..b502e51d6b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci-cd.yml @@ -347,9 +347,17 @@ jobs: deploy: name: Deploy - environment: release needs: [build-tarball, build-wheels] runs-on: ubuntu-latest + + permissions: + contents: write # IMPORTANT: mandatory for making GitHub Releases + id-token: write # IMPORTANT: mandatory for trusted publishing & sigstore + + environment: + name: pypi + url: https://pypi.org/p/aiohttp + steps: - name: Checkout uses: actions/checkout@v2.4.0 @@ -376,7 +384,27 @@ jobs: name: aiohttp version_file: aiohttp/__init__.py github_token: ${{ secrets.GITHUB_TOKEN }} - pypi_token: ${{ secrets.PYPI_API_TOKEN }} dist_dir: dist fix_issue_regex: "`#(\\d+) `_" fix_issue_repl: "(#\\1)" + + - name: >- + Publish 🐍📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + - name: Sign the dists with Sigstore + uses: sigstore/gh-action-sigstore-python@v1.2.3 + with: + inputs: >- + ./dist/*.tar.gz + ./dist/*.whl + + - name: Upload artifact signatures to GitHub Release + # Confusingly, this action also supports updating releases, not + # just creating them. This is what we want here, since we've manually + # created the release above. + uses: softprops/action-gh-release@v1 + with: + # dist/ contains the built packages, which smoketest-artifacts/ + # contains the signatures and certificates. + files: dist/**