-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Trusted Publisher support for PyPI #1575
Comments
I'd love to have this, pull requests are welcome!
I have the same question, but I think it's fine to implement it directly in maturin if it isn't hard and doesn't add too heavy dependencies. |
From the cursory look we only need I'll give it a try this weekend, but I'm not sure I'll be able to finish the PR in such short time. |
Yeah, I think it's hard to write a working test, perhaps we can just test it manually. I can take over and also try to verify that it's actually working if you can't finish it. |
Sorry to bump this old ticket but I see everything is merged but how to actually use it? (I have checked the docs). Running ...
release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing * ( Not sure if this is something that will just automatically work out of the box if the workflow is authorized in https://pypi.org/manage/project/X/settings/publishing/ ? Once again, sorry for asking but things like that are hard to test without doing the actual release of the package. Thanks for your time! 👋 |
@wiktor-k Just remove the It'd print |
Thank you very much! 🙇 |
Hi! I ended up here since I am also trying to publish using the trusted publishers workflow. I removed my
Update: I had to add two things to the
So now it looks like this: release:
name: Release
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
path: ./bindings/python/dist
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
with:
command: upload
args: --non-interactive --skip-existing ./bindings/python/dist/* |
Link: PyO3/maturin#1575 (comment) Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
Fix publishing to PyPI via trusted publishing as described in: PyO3/maturin#1575
Add extra note to "Using PyPI's trusted publishing" section to solve issues publishing to PyPI when "Environment name" is set on PyPI. Based on: PyO3#1575 (comment)
Recently, PyPI has introduced a new authorization method called "Trusted publishing", which is based on OpenID Connect (OIDC).
https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/
I wonder if it makes sense to support it in Maturin directly, or it is better to delegate it to
maturin-action
. I don't know if PyPI is ever going to support other OIDC identity providers besides GitHub.Technical details: https://docs.pypi.org/trusted-publishers/using-a-publisher/
The text was updated successfully, but these errors were encountered: