Skip to content

Commit 9efbc0c

Browse files
committed
WORKFLOW: Add automatic develop-to-master merge for releases
1 parent 204bdab commit 9efbc0c

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,26 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v4
17-
17+
with:
18+
fetch-depth: 0 # Fetch all history for merging
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
21+
- name: Merge develop to master
22+
run: |
23+
git config user.name github-actions
24+
git config user.email github-actions@github.com
25+
26+
# Ensure we're on master branch
27+
git checkout master
28+
git pull origin master
29+
30+
# Fetch and merge develop
31+
git fetch origin develop
32+
git merge origin/develop --no-ff -m "Release: Merge develop for version ${{ github.event.release.tag_name }}"
33+
34+
# Push the merge to master
35+
git push origin master
36+
1837
- name: Set up JDK
1938
uses: actions/setup-java@v4
2039
with:
@@ -57,12 +76,12 @@ jobs:
5776
git add pom.xml */pom.xml
5877
git commit -m "Prepare next development iteration [skip ci]"
5978
60-
# Push to both main and develop branches
61-
git push origin main
79+
# Push to both master and develop branches
80+
git push origin master
6281
6382
# Also update develop branch with new snapshot version
6483
git fetch origin develop
6584
git checkout develop
66-
git merge main --strategy-option=theirs
85+
git merge master --strategy-option=theirs
6786
git push origin develop
6887

0 commit comments

Comments
 (0)