Skip to content
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

Pivot PyPI publishing to use trusted publishers #1001

Merged
merged 3 commits into from
Oct 18, 2023

Conversation

mtreinish
Copy link
Member

This commit updates the wheel job CI configuration to leverage PyPI's trusted publisher mechanism. Moving forward the bot account we've been using will be deleted (as it will require 2fa) and the rustworkx github repository's wheels.yml workflow has been setup as a trusted publisher. This commit updates the job configuration per:

https://docs.pypi.org/trusted-publishers/using-a-publisher/

to autheticate the job directly against pypi for publishing the package files without needign any user credentials.

This commit updates the wheel job CI configuration to leverage PyPI's
trusted publisher mechanism. Moving forward the bot account we've been
using will be deleted (as it will require 2fa) and the rustworkx github
repository's wheels.yml workflow has been setup as a trusted publisher.
This commit updates the job configuration per:

https://docs.pypi.org/trusted-publishers/using-a-publisher/

to autheticate the job directly against pypi for publishing the package
files without needign any user credentials.
@mtreinish mtreinish added this to the 0.14.0 milestone Oct 10, 2023
@coveralls
Copy link

coveralls commented Oct 10, 2023

Pull Request Test Coverage Report for Build 6562574063

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 96.523%

Totals Coverage Status
Change from base Build 6540082471: 0.0%
Covered Lines: 15544
Relevant Lines: 16104

💛 - Coveralls

Copy link
Collaborator

@IvanIsCoding IvanIsCoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I think we should trigger it once before 0.14 to publish the current state to TestPyPI. Apparently it's not very hard:

repository-url: https://test.pypi.org/legacy/

@mtreinish
Copy link
Member Author

It's a good thing you asked me to test this, I just setup my fork to push to test.pypi.org and it failed because the publish action only works on linux: https://github.com/mtreinish/retworkx/actions/runs/6538918751/job/17755862386#step:8:1

This is actually documented see: https://github.com/pypa/gh-action-pypi-publish#non-goals I'll adjust the job to work with this and then retest.

github-merge-queue bot pushed a commit to qiskit-community/qiskit-experiments that referenced this pull request Oct 16, 2023
### Summary

This PR follows Qiskit/rustworkx#1001 to update
the release CI workflow to use PyPI's trusted publisher mechanism.
@mtreinish
Copy link
Member Author

Aside from the issue on non-linux runners, the trusted publisher upload works as expected to test pypyi:

@IvanIsCoding
Copy link
Collaborator

It's a good thing you asked me to test this, I just setup my fork to push to test.pypi.org and it failed because the publish action only works on linux: https://github.com/mtreinish/retworkx/actions/runs/6538918751/job/17755862386#step:8:1

This is actually documented see: https://github.com/pypa/gh-action-pypi-publish#non-goals I'll adjust the job to work with this and then retest.

An unfortunate surprise but I am glad we caught it. Upload artifacts seems like extra steps but I don’t think they’ll add Windows/mac support ever by the wording of their documentation

@mtreinish
Copy link
Member Author

Ok, I've updated the job definition in: 781014a to use a a shared upload stage. Then I pushed another test to my fork branch on test pypi here: mtreinish@284e055
and it is working as expecting:

https://github.com/mtreinish/retworkx/actions/runs/6552138251
https://test.pypi.org/project/rustworkx/0.14.1/#files (I bumped the version number to avoid file conflicts)

(the retworkx job failure is because I didn't bother configuring the trusted publisher pipeline for test pypi on retworkx)

Copy link
Collaborator

@IvanIsCoding IvanIsCoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mtreinish mtreinish added automerge Queue a approved PR for merging and removed automerge Queue a approved PR for merging labels Oct 18, 2023
@mtreinish mtreinish added the automerge Queue a approved PR for merging label Oct 18, 2023
@mergify mergify bot merged commit f4ee4cf into Qiskit:main Oct 18, 2023
26 checks passed
@mtreinish mtreinish deleted the use-trusted-publishers branch October 24, 2023 13:07
mergify bot pushed a commit to qiskit-community/qiskit-experiments that referenced this pull request Nov 1, 2023
### Summary

This PR follows Qiskit/rustworkx#1001 to update
the release CI workflow to use PyPI's trusted publisher mechanism.

(cherry picked from commit cfb47e2)
nkanazawa1989 pushed a commit to nkanazawa1989/qiskit-experiments that referenced this pull request Jan 10, 2024
### Summary

This PR follows Qiskit/rustworkx#1001 to update
the release CI workflow to use PyPI's trusted publisher mechanism.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Queue a approved PR for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants