-
Notifications
You must be signed in to change notification settings - Fork 17
CI: Add workflows for automated publish #46
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?
Conversation
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
|
So to summarize the workflow is as follows, right?
|
| command: release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_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.
Should we add a comment here, clarifying the permissions the token should have? I'm thinking we will probably be copying this code to more repos in the future, so it could be helpful to specify the requirement here.
In my opinion that would be:
- the token should only allow updates, not publishing new crates or yanking.
- Ideally it would be scoped to the crate, although that wouldn't work with workspaces.
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.
We might want publish if we introduce new crates. release plz suggest: https://release-plz.ieni.dev/docs/github/quickstart#2-set-the-cargo_registry_token-secret
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.
Publishing new crates shouldn't happen very often, so I feel like it would be fine to have a human due to that when necessary.
on the other hand, it doesn't matter too much from a security perspective, since permissions to update a crate (that is potentially used by many others) is more valuable than permissions to publish a new crate (which would be unused by default).
I guess in any case we would need to make sure that we monitor the crates.io notification emails for suspicious activity.
Yes. One can also manually do step 1 (for current version we already have this: #45). So now we would only need step 3. |
|
LGTM, but in any case this will need a review from an admin |
This PR adds
Prepare new releaseworkflow which needs to be manually dispatched (available only to contributors) to create new release PR, that one can edit/change before merging.Then there is also
Publish releaseworkflows, which is triggered by creating a tag (we should restrict those using ruleset to release managers) and publishes release to crates.io and creates GitHub release from tag.Based on https://release-plz.ieni.dev/docs/github/quickstart.
Needs admin to follow instructions on https://release-plz.ieni.dev/docs/github/quickstart#1-change-github-actions-permissions for secrets and workflow permissions.