Skip to content

Commit cda7fb2

Browse files
authored
Automate rolling of SNAPSHOT version in pom (#1438)
* Automate rolling of SNAPSHOT version in pom Follow-up to discussion in: #1412
1 parent cbe3105 commit cda7fb2

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.github/workflows/pom_update.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
on:
2+
workflow_call:
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
8+
jobs:
9+
create_pr:
10+
name: Create Pull Request
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Set up Git
16+
run: |
17+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
18+
git config --global user.name "github-actions[bot]"
19+
echo "BRANCH=pom-snapshot-updt" >> $GITHUB_ENV
20+
- name: Build PR
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
run: |
24+
git checkout -b $BRANCH
25+
./mvnw build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT
26+
git add .
27+
git commit -m "Update pom SNAPSHOT version" -m "A release just completed, this PR increments the SNAPSHOT version in pom.xml" --signoff
28+
git push --set-upstream origin $BRANCH --force
29+
gh pr create --fill

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,6 @@ jobs:
6969
${{ steps.changelog.outputs.changelog }}
7070
draft: false
7171
prerelease: false
72-
72+
call_pom_update:
73+
needs: publish
74+
uses: ./.github/workflows/pom_update.yml

0 commit comments

Comments
 (0)