-
Notifications
You must be signed in to change notification settings - Fork 980
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 publishing: support for Cirrus CI #14542
Comments
That's a large part of what's necessary! The next step would be figuring out which of the "Cirrus Added Claims" would be specific to a given PyPI project (e.g. for GitHub, this is a combination of the owner/repository/workflow claims). At a glance, this would probably be After this, adding the integration to allow PyPI to trust the OIDC token and for PyPI users to configure Cirrus CI as a Trusted publisher would be next steps. |
Considering I define something like the following (untested, just for the sake of brainstorming): # .cirrus.yml
check_task: ...
build_task: ...
test_task: ...
publish_task:
name: publish (Linux - 3.10)
container: {image: "python:3.10-bullseye"}
depends_on: [check, build, test]
only_if: $CIRRUS_TAG =~ 'v\d.*' && $CIRRUS_USER_PERMISSION == "admin"
env:
CIRRUS_OIDC_TOKEN_AUDIENCE: pypi
TWINE_REPOSITORY: pypi
TWINE_USERNAME: __token__
install_script: pip install tox
prepare_script: <...>
get_token_script:
- resp=$(curl -X https://pypi.org/_/oidc/cirrus-ci/mint-token -d "{\"token\": \"${CIRRUS_OIDC_TOKEN}\"}")
- api_token=$(jq '.token' <<< "${resp}")
- echo "TWINE_PASSWORD=${api_token}" >> $CIRRUS_ENV
publish_script:
- ls dist/*
- python -m twine upload dist/*
I would expect the token to have The |
I think we'd want something akin to the GitHub Actions workflow filename that is consistent for every build, which I think The I'm curious why you include |
Yes, you are right, I got a bit confused. I thought that |
This is inline with requests such as #13575 and #13888
Cirrus CI supports OpenID connect tokens (presented to the user via the
$CIRRUS_OIDC_TOKEN
environment variable) and an user can personalise the audience by setting the$CIRRUS_OIDC_TOKEN_AUDIENCE
environment variable.Hopefully this is enough for PyPI to interact with it? Is there anything else that would be necessary?
The text was updated successfully, but these errors were encountered: