Add a GitHub Actions workflow for publishing a release #691
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #689, a GitHub Actions workflow was added for the first stage of the release process - preparing the release PR.
Now, another workflow has been added for the second stage of the release process - publishing to https://crates.io and creating the GitHub Release.
This workflow makes use of the
cargo-release
tool, which calculates the crate dependency graph for us, so we don't need to hardcode a crate publish ordering:https://github.com/crate-ci/cargo-release/blob/master/docs/reference.md
This tool also skips any already-published crates, so if say a release failed halfway through publishing to crates.io, the job could be retriggered and would successfully resume publishing.
The new workflow does however perform a single check to see if the GitHub Release already exists, to prevent accidentally re-running an already completed successfully release (which might move the git tag):
https://cli.github.com/manual/gh_release_view
Credentials are configured via the
CARGO_REGISTRY_TOKEN
env var, which has been set to the scoped crates.io API token of a service account. That service account has already been added to thelibcnb*
andlibherokbuildpack
crates:https://doc.rust-lang.org/cargo/reference/config.html#credentials
https://crates.io/users/heroku-languages-release-bot
https://github.com/heroku/languages-team/pull/146
The awk-based changelog extraction technique was inspired by:
https://stackoverflow.com/questions/38972736/how-to-print-lines-between-two-patterns-inclusive-or-exclusive-in-sed-awk-or
Closes #595.
GUS-W-14177169.