Add reusable Rust release workflows#60
Conversation
| - Any pull request that is not passing our CI tests & builds will not be merged. This implies incorrect formatting errors, compilation errors, clippy lints, or any other kind of inconsistency with your code. | ||
| - Do not open PRs that are not linked or related to a previously opened issue. | ||
| - Update the `Unreleased` section of the `CHANGELOG` if your PR includes anything that's worth mentioning in there. Avoid adding things like doc-nitpicks and similar changes which do not affect directly any added, fixed, removed or changed feature. | ||
| - Do not edit `CHANGELOG.md` files manually. Release changelogs are generated by the Rust release automation from merged PR metadata. |
There was a problem hiding this comment.
I got the rationale behind this, but I strongly believe that having the unreleased section compiled by contributors will help to understand what's in there, and help us in a lot of different situations (keep track of what's unreleased, know possible breaking changes that needs major bump, etc etc)
Instead of letting the files to be automatically generated, it would be useful (imho) to have CI to check what devs put in the CHANGELOG against what's supposed to be there (according to the CI), maybe adding some RFC to the PR
This will help in 2 ways:
- let the control of the CHANGELOG to developers
- help the developers in case of something missing or not coherent
There was a problem hiding this comment.
To be clear, I'm not against having it automatically generated. I'm against having it generated only when releasing it.
If it would be possible to autogenerate it while merging every single PR that would be awesome.
There was a problem hiding this comment.
I would need to look into that more. This release-plz flow is a fairly big change from how we do releases.
If we use their commit-based approach, we should not do tiny commits anymore because it would bloat generated changelogs.
If we want to do it based on PR titles/description, squash-merge would be the cleanest option.
We can also keep the old manual changelog approach though. I mostly care about the crate release/publishing side of release-plz. But let's discuss during the standup in the morning.
xevisalle
left a comment
There was a problem hiding this comment.
LGTM. I don't have a strong preference, but it looks good to me the current approach, it allows not having to update the same changelog twice if for instance for any reason we revert changes before release. I'm OK though if we end up following @herr-seppia 's suggestion.
Summary
This PR adds reusable Rust release automation workflows for Dusk crates:
rust-release-plan.ymlcreates or updates release-plz release PRsrust-release-check.ymlvalidates release PRs and runs release/publish dry-runsrust-publish-crates.ymlpublishes through release-plz using crates.io trusted publishingThe publish flow uses OIDC trusted publishing directly through release-plz. It does not use
CARGO_REGISTRY_TOKENorrust-lang/crates-io-auth-action.Release impact
This moves our Rust crate releases toward a release-plz owned flow:
publish-packagesCaller repos should use a local
.github/workflows/release-plz.ymlworkflow and configure crates.io trusted publishing with workflow filenamerelease-plz.ymland environmentcrates-io.Caller flow
A caller repo has one local release workflow entry point, usually
.github/workflows/release-plz.yml.That workflow exposes two manual commands:
release-pr: creates or updates the release PRpublish: publishes after the release PR has been reviewed and mergedThe intended sequence is:
release-prpublishPublishing is intentionally manual after merge. The publish job uses the
crates-ioGitHub Environment, so repository or organization rules can require approval before crates.io receives the OIDC-backed publish.Versioning
Version bumps are owned by release-plz.
When
release-prruns, release-plz compares the repo with the latest published crate version and uses merged commit history plusrelease-plz.tomlto prepare the release PR. That PR contains the version bump and changelog updates.For normal releases:
feat(crate): ...,fix(crate): ...,docs(crate): ...,chore(crate): ...!or aBREAKING CHANGE:footer for breaking changesAfter the release PR is merged,
publishpublishes the version already present on the default branch.'For more details see release-plz
Registry setup required
Before using
publish, configure crates.io trusted publishing for the particular crate:dusk-networkREPO-NAMErelease-plz.ymlcrates-io