-
Notifications
You must be signed in to change notification settings - Fork 594
[CLI] Pipelines to publish casp to PyPI #5061
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: master
Are you sure you want to change the base?
Conversation
|
Very nice |
| # set the version here. | ||
| version = "0.0.8" | ||
| authors = [ | ||
| { name="PauloVLB", email="paulovlb@google.com" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried that with Paulo finishing his internship, this email won't be available anymore and the workflow might start failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. As mentioned in #4987, the publishing account should be validated.
I suggest creating a new ClusterFuzz account (since this one doesn't seem right) in both TestPyPI and PyPI and changing it.
We'd also need to change the secrets used in the pipelines (CASP_PYPI_API_TOKEN and CASP_TEST_PYPI_API_TOKEN).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To generate tokens, follow these steps in each environment:
- Go to pypi.org/manage/account/ or test.pypi.org/manage/account/
- Scroll down to "API tokens"
- Click "Add API Token"
- Provide a token name and scope (must include the CLI project)
- Click "Create token"
You can also find a step-by-step guide on how to publish locally on my notes, in the "Commands" section.
Summary
This PR establishes the CI/CD pipelines required to automate the publishing of the casp CLI to both TestPyPI (for development) and PyPI (for production).
Pipelines Added
1. Publish to PyPI (release event)
Trigger: runs when a new GitHub Release is published.
Change Detection: checks if there are actual changes in
cli/caspcompared to the previous tag before proceeding.Versioning: automatically updates
pyproject.tomlto match the release tag (e.g., v1.2.0 -> 1.2.0).Action: builds and uploads the package to the official PyPI repository.
2. Publish to TestPyPI (push event)
Trigger: runs on every push to master that modifies files within
cli/casp/.Versioning: generates a unique snapshot version using the format
<last_tag>.<timestamp>(e.g., 1.2.0.17123456).Action: builds and uploads the package to TestPyPI to facilitate immediate testing of new changes.