-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Release tooling: Release stable releases from latest-release
#24106
Merged
Merged
Changes from 25 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
f5430d3
rename release preparement workflows
JReinhold 8d582d7
merge stable to latest-release instead of next-release, resolving mer…
JReinhold 1161b7a
more renaming of new release workflows
JReinhold d6297bf
only commit changelog changes when there are actual changes
JReinhold 670bc51
add comments
JReinhold d5df684
simplify
JReinhold 431ec63
ensure next is always ahead of main during stable releases
JReinhold 5075165
improve readability of publish script
JReinhold 44e988c
pul all release workflows in same concurrency group
JReinhold bff632d
add todos
JReinhold 8eddd45
Merge branch 'next' of github.com:storybookjs/storybook into release-…
JReinhold ba8e5fe
cancel any release-preparation runs in progress
JReinhold a84e270
cleanup
JReinhold e1a2172
only consider open PRs when looking for frozen state
JReinhold 4d569f2
update tests
JReinhold 00a9089
Merge branch 'next' of github.com:storybookjs/storybook into release-…
JReinhold 4bf6ba4
cleanup
JReinhold 25ebf5c
fix type errors
JReinhold 32ba0d9
Merge branch 'next' of github.com:storybookjs/storybook into release-…
JReinhold 9ca7ed4
cancel when 0 patches to pick
JReinhold 22f12e6
temp rename workflow to test
JReinhold e719c53
try number when reading pr-count
JReinhold d757590
compare less than 1
JReinhold 8466a08
check non-null in pr count
JReinhold d83d422
rename patch workflow
JReinhold ca7f6f8
hotfix -> patch, next-release -> non-patch-release
JReinhold 15b5933
more renaming
JReinhold ed18a24
move ensure-next-ahead from a bash script to a tested node script
JReinhold 930adf4
move bash script to cancel preparation runs to tested node script
JReinhold 0b35c18
Merge branch 'next' into release-stable-to-latest
JReinhold 72837ae
fix tests
JReinhold 406e0a5
Merge branch 'release-stable-to-latest' of github.com:storybookjs/sto…
JReinhold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,8 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
prepare-patch-pull-request: | ||
name: Prepare patch pull request | ||
prepare-hotfix-pull-request: | ||
name: Prepare hotfix pull request | ||
runs-on: ubuntu-latest | ||
environment: release | ||
defaults: | ||
|
@@ -56,7 +56,7 @@ jobs: | |
id: check-frozen | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: yarn release:is-pr-frozen --patch | ||
run: yarn release:is-pr-frozen --hotfix | ||
|
||
- name: Cancel when frozen | ||
if: steps.check-frozen.outputs.frozen == 'true' && github.event_name != 'workflow_dispatch' | ||
|
@@ -88,6 +88,15 @@ jobs: | |
git config --global user.email '[email protected]' | ||
yarn release:pick-patches | ||
|
||
- name: Cancel when no hotfixes to pick | ||
if: steps.pick-patches.outputs.pr-count == '0' && steps.pick-patches.outputs.pr-count != null | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# From https://stackoverflow.com/a/75809743 | ||
run: | | ||
gh run cancel ${{ github.run_id }} | ||
gh run watch ${{ github.run_id }} | ||
|
||
- name: Bump version deferred | ||
id: bump-version | ||
if: steps.unreleased-changes.outputs.has-changes-to-release == 'true' | ||
|
@@ -121,7 +130,7 @@ jobs: | |
git config --global user.email '[email protected]' | ||
git checkout -b version-patch-from-${{ steps.versions.outputs.current }} | ||
git add . | ||
git commit -m "Write changelog for ${{ steps.versions.outputs.next }}" || true | ||
git commit -m "Write changelog for ${{ steps.versions.outputs.next }} [skip ci]" || true | ||
git push --force origin version-patch-from-${{ steps.versions.outputs.current }} | ||
|
||
- name: Generate PR description | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
prepare-prerelease-pull-request: | ||
prepare-next-pull-request: | ||
name: Prepare prerelease pull request | ||
runs-on: ubuntu-latest | ||
environment: release | ||
|
@@ -112,21 +112,35 @@ jobs: | |
run: | | ||
yarn release:version --deferred --release-type ${{ inputs.release-type || 'prerelease' }} ${{ inputs.pre-id && format('{0} {1}', '--pre-id', inputs.pre-id) || '' }} --verbose | ||
|
||
- name: Check release vs prerelease | ||
id: is-prerelease | ||
run: yarn release:is-prerelease ${{ steps.bump-version.outputs.next-version }} | ||
|
||
- name: Write changelog | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
yarn release:write-changelog ${{ steps.bump-version.outputs.next-version }} --verbose | ||
|
||
- name: 'Commit changes to branch: version-prerelease-from-${{ steps.bump-version.outputs.current-version }}' | ||
- name: 'Commit changes to branch: version-next-from-${{ steps.bump-version.outputs.current-version }}' | ||
working-directory: . | ||
run: | | ||
git config --global user.name 'storybook-bot' | ||
git config --global user.email '[email protected]' | ||
git checkout -b version-prerelease-from-${{ steps.bump-version.outputs.current-version }} | ||
git checkout -b version-next-from-${{ steps.bump-version.outputs.current-version }} | ||
git add . | ||
git commit -m "Write changelog for ${{ steps.bump-version.outputs.next-version }} [skip ci]" || true | ||
git push --force origin version-next-from-${{ steps.bump-version.outputs.current-version }} | ||
|
||
- name: Resolve merge-conflicts with base branch | ||
if: steps.is-prerelease.outputs.prerelease == 'true' | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git pull origin latest-release | ||
git checkout --ours . | ||
git add . | ||
git commit -m "Write changelog for ${{ steps.bump-version.outputs.next-version }}" || true | ||
git push --force origin version-prerelease-from-${{ steps.bump-version.outputs.current-version }} | ||
git commit -m "Merge latest-release into version-next-from-${{ steps.bump-version.outputs.current-version }} with conflicts resolved to ours [skip ci]" | ||
|
||
- name: Generate PR description | ||
id: description | ||
|
@@ -144,14 +158,15 @@ jobs: | |
gh pr edit \ | ||
--repo "${{github.repository }}" \ | ||
--title "Release: $CAPITALIZED_RELEASE_TYPE ${{ inputs.pre-id && format('{0} ', inputs.pre-id) }}${{ steps.bump-version.outputs.next-version }}" \ | ||
--base ${{ steps.is-prerelease.outputs.prerelease == 'true' && 'next-release' || 'latest-release' }} \ | ||
--body "${{ steps.description.outputs.description }}" | ||
else | ||
gh pr create \ | ||
--repo "${{github.repository }}"\ | ||
--title "Release: $CAPITALIZED_RELEASE_TYPE ${{ inputs.pre-id && format('{0} ', inputs.pre-id) }}${{ steps.bump-version.outputs.next-version }}" \ | ||
--label "release" \ | ||
--base next-release \ | ||
--head version-prerelease-from-${{ steps.bump-version.outputs.current-version }} \ | ||
--base ${{ steps.is-prerelease.outputs.prerelease == 'true' && 'next-release' || 'latest-release' }} \ | ||
--head version-next-from-${{ steps.bump-version.outputs.current-version }} \ | ||
--body "${{ steps.description.outputs.description }}" | ||
fi | ||
|
||
|
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Brings back #24274
However this step won't have any effect until this PR has been cherry-picked to
main
, because thepick-patches.ts
script that setspr-count
runs frommain
.The last null check ensures that when this is not merged to
main
, this will never cancel, to not block a release process.See a test run of this here: https://github.com/storybookjs/storybook/actions/runs/6299420488/job/17100151688