Skip to content

Commit a9a1420

Browse files
chore: avoid re-run and clean release branch
Signed-off-by: Joris Mancini <[email protected]>
1 parent 00c586e commit a9a1420

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ on:
77

88
jobs:
99
build:
10-
10+
if: "!contains(github.event.head_commit.message, 'Release')"
1111
runs-on: ubuntu-latest
12-
1312
steps:
1413
- name: Set up JDK 17
1514
uses: actions/setup-java@v1
@@ -46,7 +45,7 @@ jobs:
4645
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
4746
git checkout -b release-${{ github.ref_name }}
4847
git add .
49-
git commit -m "Prepare release ${{ github.ref_name }}"
48+
git commit -m "Release ${{ github.ref_name }}"
5049
git tag ${{ github.ref_name }}
5150
5251
- name: Build with Maven
@@ -81,14 +80,15 @@ jobs:
8180

8281
- name: Commit and tag release version
8382
run: |
83+
git checkout -b next-release-v${{ env.GITHUB_MAJOR_VERSION }}.${{ env.GITHUB_MINOR_VERSION }}.0
8484
git add .
8585
git commit -m "Prepare next release v${{ env.GITHUB_MAJOR_VERSION }}.${{ env.GITHUB_MINOR_VERSION }}.0"
8686
8787
- name: Rebase main onto this branch
8888
run: |
8989
git fetch
9090
git checkout main
91-
git rebase release-${{ github.ref_name }}
91+
git rebase next-release-v${{ env.GITHUB_MAJOR_VERSION }}.${{ env.GITHUB_MINOR_VERSION }}.0
9292
git push -f origin main
9393
git push origin release-${{ github.ref_name }}
9494
git push origin ${{ github.ref_name }}

0 commit comments

Comments
 (0)