-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PR #7359/7911f1e9 backport][3.8] Set up secretless publishing to P…
…yPI (#7360) Co-authored-by: Sviatoslav Sydorenko <[email protected]>
- Loading branch information
1 parent
8d45f9c
commit 3577b1e
Showing
1 changed file
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
|
@@ -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+) <https://github.com/aio-libs/aiohttp/issues/\\1>`_" | ||
fix_issue_repl: "(#\\1)" | ||
|
||
- name: >- | ||
Publish 🐍📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
- name: Sign the dists with Sigstore | ||
uses: sigstore/[email protected] | ||
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/** |