-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24106 from storybookjs/release-stable-to-latest
Release tooling: Release stable releases from `latest-release`
- Loading branch information
Showing
19 changed files
with
648 additions
and
115 deletions.
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 |
---|---|---|
|
@@ -34,7 +34,7 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
prepare-prerelease-pull-request: | ||
prepare-non-patch-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-non-patch-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-non-patch-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-non-patch-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-non-patch-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-non-patch-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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,15 @@ jobs: | |
git config --global user.email '[email protected]' | ||
yarn release:pick-patches | ||
- name: Cancel when no patches 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
Oops, something went wrong.