From 72eadaa141c13874a98a24a1389e887a5b3c7ddb Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 17 May 2024 14:18:10 +0200 Subject: [PATCH] release majors/minors from next-release and force push to main+latest-release --- .../workflows/prepare-non-patch-release.yml | 20 +------------------ .github/workflows/publish.yml | 8 ++++++++ 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/prepare-non-patch-release.yml b/.github/workflows/prepare-non-patch-release.yml index 3cbf8f8b1fc9..c495114d461e 100644 --- a/.github/workflows/prepare-non-patch-release.yml +++ b/.github/workflows/prepare-non-patch-release.yml @@ -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 }} @@ -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: @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8aa7928748bc..61566b49d5bb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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: .