Release tooling: Defer version bumping to the publish step#23393
Merged
Conversation
shilman
approved these changes
Jul 11, 2023
Member
shilman
left a comment
There was a problem hiding this comment.
Great work @JReinhold 🙌 Looks great
15 tasks
JReinhold
added a commit
that referenced
this pull request
Jul 12, 2023
Release tooling: Defer version bumping to the publish step (cherry picked from commit a930066)
5 tasks
JReinhold
added a commit
that referenced
this pull request
Jul 12, 2023
…oning Release tooling: Defer version bumping to the publish step - Cherry picking #23393
storybook-bot
pushed a commit
that referenced
this pull request
Jul 12, 2023
Release tooling: Defer version bumping to the publish step (cherry picked from commit a930066)
Merged
27 tasks
storybook-bot
pushed a commit
that referenced
this pull request
Jul 12, 2023
Release tooling: Defer version bumping to the publish step (cherry picked from commit a930066)
storybook-bot
pushed a commit
that referenced
this pull request
Jul 12, 2023
Release tooling: Defer version bumping to the publish step (cherry picked from commit a930066)
5 tasks
8 tasks
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I will manually cherry-pick this back to
mainin follow-up PRWhat I did
This PR changes the release flow to defer the actual version bump to the publish step instead of when preparing the release PRs. This makes it possible to run CI on the release PRs. It will still calculate the version bump up front.
The
release:versionscript now take two additional flags:--deferred: This will keep the same bumping logic, except instead of bumping the versions in all the packages it will simply set a"deferredNextVersion"property incode/package.jsonand exit.--apply: This will apply the version set at"deferredNextVersion", by actually bumping all the package's versions as usual. It's invalid to use this flag with--release-typeor--pre-id, since--applywill not do any increment calculation.The release preparation workflows then uses
--deferredto set the deferred version.The publish workflow will look for the
"deferredNextVersion"and if it is set, it will runrelease:versionwith--applyand commit the changes. It will not be set in cases where patch releases don't contain any releasable changes.This deferred workflow doesn't make much sense to run locally, and it's not necessary to do so, but it can be if you want to.
How to test
cd scriptsyarn release:version --release-type preminor --pre-id test"deferredNextVersion"is not set incode/package.jsonyarn release:version --apply"deferredNextVersion"is removed againChecklist
MIGRATION.MD
Maintainers
make sure to add the
ci:mergedorci:dailyGH label to it.["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]