-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
CI: add PyPI Trusted-Publishing “publish” job to wheels workflow (#61669) #61718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 14 commits
a419d40
abda427
6e9027c
e3e583d
9f9013e
4e4cc1e
d311ce4
6360900
c15c176
0332486
c675826
3cac6a5
45291a7
da41c89
409dcb4
50afff6
b94eb08
58cb179
7359e1b
f482759
0aa892f
da3c281
ba4c3bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -219,3 +219,43 @@ jobs: | |
source ci/upload_wheels.sh | ||
set_upload_vars | ||
upload_wheels | ||
|
||
################################################ | ||
# Publish Wheels and Source Distribution to PyPI | ||
################################################ | ||
publish: | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
EvMossan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
needs: | ||
- build_sdist | ||
- build_wheels | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: pypi | ||
|
||
permissions: | ||
id-token: write # OIDC token for Trusted Publishing | ||
contents: read | ||
|
||
steps: | ||
# 1. Pull every artifact produced by the two upstream jobs | ||
EvMossan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Download all artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: dist # all files land in ./dist/** | ||
|
||
# 2. Move wheels & sdist into a flat 'upload' dir (skip Pyodide wheels) | ||
EvMossan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Collect files | ||
run: | | ||
mkdir -p upload | ||
# skip anything containing 'pyodide' in the filename | ||
find dist -name '*pyodide*.whl' -prune -o \ | ||
-name '*.whl' -exec mv {} upload/ \; | ||
find dist -name '*.tar.gz' -exec mv {} upload/ \; | ||
|
||
# 3. Publish to PyPI using Trusted Publishing | ||
EvMossan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Publish to PyPI (Trusted Publishing) | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://upload.pypi.org/legacy/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this line needed? (it's not included in the example in https://docs.pypi.org/trusted-publishers/using-a-publisher/) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not necessary, and as far as I know there's no recommendation to hard-code it. When the upload API 2.0 PEP lands, this URL and action will change anyway. |
||
packages-dir: upload | ||
EvMossan marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.