Skip to content

Commit

Permalink
Automate rolling of SNAPSHOT version in pom (#1438)
Browse files Browse the repository at this point in the history
* Automate rolling of SNAPSHOT version in pom

Follow-up to discussion in: #1412
  • Loading branch information
kingthorin authored Nov 18, 2024
1 parent cbe3105 commit cda7fb2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/pom_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
workflow_call:

permissions:
contents: write
pull-requests: write

jobs:
create_pr:
name: Create Pull Request
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
echo "BRANCH=pom-snapshot-updt" >> $GITHUB_ENV
- name: Build PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git checkout -b $BRANCH
./mvnw build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT
git add .
git commit -m "Update pom SNAPSHOT version" -m "A release just completed, this PR increments the SNAPSHOT version in pom.xml" --signoff
git push --set-upstream origin $BRANCH --force
gh pr create --fill
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,6 @@ jobs:
${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false

call_pom_update:
needs: publish
uses: ./.github/workflows/pom_update.yml

0 comments on commit cda7fb2

Please sign in to comment.