Add justfile recipes to help with releasing
#2077
Merged
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.
As described in #1970, the
release.ymlworkflow can rarely (if ever) trigger onpush, becausecargo-smart-releaseusually pushes more than three tags at a time, as used here.This makes two changes:
justfileto make it easier to trigger the workflow viaworkflow_dispatch.pushevent from triggering the workflow except for testing tags, so it's not accidentally triggered twice when using the new recipes.There are substantial further details in the commit messages. I have tested everything in my fork, for various scenarios--for example, here's one of the runs--except I have only slightly tested
roll-release. It may be that something likejust roll-release -ewill usually be sufficient when releasing, I am not sure.I am not sure about the
roll-releaserecipe as currently written. If one were to runjust roll-release, then it would do a dry-run release, but then attempt to run the actual release workflow.cargo smart-releasefor a dry run (even if it would have just one command), with theroll-releaserecipe without passing-e/--execute, to discourage such usage where it would not make sense to trigger the workflow. Maybe theroll-releaserecipe should pass-e/--execute.roll-releasefor a dry-run should not be discouraged: if there is nov*tag atHEAD, then therun-release-workflowrecipe will look for a uniquev*tag via theunique-v-tagrecipe, which will fail, and nogh workflowcommand will be invoked.v*tag at the tip of a branch before runningcargo smart-releasewith the intent that new commits will be created with changelogs and a release will be performed. This seems unlikely, but I don't know of any fundamental reason it could not happen. (For example, a preceding just-completed release of at least one crate could have been yanked due to a SemVer-related problem.) If that happened, then we could wrongly rerunrelease.ymlon av*tag.In view of my uncertainty as to how safe and usable the current design is, I'll wait for a review before merging.
Edit: Clarified and fixed some incorrect wording in the above bullet points.