Skip to content

Commit

Permalink
Merge pull request #27182 from storybookjs/jeppe/simplify-minor-releases
Browse files Browse the repository at this point in the history
Release Tooling: Force push major/minor releases to `main` and `next-release`
  • Loading branch information
shilman authored May 19, 2024
2 parents df51f12 + 72eadaa commit a5c7f7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
20 changes: 1 addition & 19 deletions .github/workflows/prepare-non-patch-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ 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 }} --verbose

- name: Write changelog
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -133,19 +129,6 @@ jobs:
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 == 'false'
working-directory: .
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config pull.rebase false
git pull --no-commit --no-ff origin latest-release || true
git checkout --ours .
git add .
git commit --no-verify -m "Merge latest-release into version-non-patch-from-${{ steps.bump-version.outputs.current-version }} with conflicts resolved to ours [skip ci]"
git push origin version-non-patch-from-${{ steps.bump-version.outputs.current-version }}
- name: Generate PR description
id: description
env:
Expand All @@ -162,14 +145,13 @@ 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 ${{ steps.is-prerelease.outputs.prerelease == 'true' && 'next-release' || 'latest-release' }} \
--base next-release \
--head version-non-patch-from-${{ steps.bump-version.outputs.current-version }} \
--body "${{ steps.description.outputs.description }}"
fi
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ jobs:
git merge ${{ github.ref_name }}
git push origin ${{ steps.target.outputs.target }}
- name: Force push from 'next' to 'latest-release' and 'main' on minor/major releases
if: github.ref_name == 'next-release' && steps.is-prerelease.outputs.prerelease == 'false'
run: |
git checkout next
git pull
git push --force origin latest-release
git push --force origin main
- name: Sync CHANGELOG.md from `main` to `next`
if: steps.target.outputs.target == 'main'
working-directory: .
Expand Down

0 comments on commit a5c7f7f

Please sign in to comment.