Skip to content

Commit 2e66c31

Browse files
committed
Add workflow to tag a release
1 parent 96ad7eb commit 2e66c31

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Tag release and move to next development version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
releaseVersion:
7+
description: "Release version"
8+
required: true
9+
snapshotVersion:
10+
description: "Next snapshot version"
11+
required: true
12+
13+
jobs:
14+
15+
release:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
steps:
20+
- name: Checkout source code
21+
uses: actions/checkout@v4.2.2
22+
23+
- name: Set up JDK 25
24+
uses: actions/setup-java@v5
25+
with:
26+
java-version: '25'
27+
distribution: 'temurin'
28+
cache: 'maven'
29+
30+
- name: Set up git
31+
run: |
32+
git config --global user.name 'github-actions[bot]'
33+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
34+
35+
- name: Capture versions
36+
run: |
37+
echo RELEASE_VERSION=${{ github.event.inputs.releaseVersion }} >> $GITHUB_ENV
38+
echo SNAPSHOT_VERSION=${{ github.event.inputs.snapshotVersion }} >> $GITHUB_ENV
39+
40+
- name: Tag release
41+
run: |
42+
./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION
43+
git commit -a -m "Release version $RELEASE_VERSION"
44+
git tag -a v$RELEASE_VERSION -m "Release version $RELEASE_VERSION"
45+
git push origin v$RELEASE_VERSION
46+
47+
- name: Move to next development version
48+
run: |
49+
./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion=$SNAPSHOT_VERSION
50+
git commit -a -m "Next development version"
51+
git push origin main

0 commit comments

Comments
 (0)