Skip to content

Commit e75f7bc

Browse files
github action generate version
1 parent f10202b commit e75f7bc

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ jobs:
2727
restore-keys: |
2828
${{ runner.os }}-maven-
2929
30+
# Set version from tag
31+
- name: Set version from tag
32+
run: |
33+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
34+
mvn versions:set -DnewVersion=${TAG_VERSION} -DgenerateBackupPoms=false
35+
3036
# Run Maven to package the project
3137
- name: Build with Maven
3238
run: mvn clean package -DskipTests

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@
190190
<connectionUrl>scm:git:[email protected]:testingbot/testingbot-tunnel.git</connectionUrl>
191191
</configuration>
192192
</plugin>
193+
<plugin>
194+
<groupId>org.codehaus.mojo</groupId>
195+
<artifactId>versions-maven-plugin</artifactId>
196+
<version>2.16.2</version>
197+
</plugin>
193198
</plugins>
194199
</build>
195200
<dependencies>

0 commit comments

Comments
 (0)