Skip to content

Commit 5f53e8c

Browse files
committed
Get java release version from tag. The tag is assumed to follow the format java-vX.Y.Z which is set when the release action is started.
1 parent b0d2473 commit 5f53e8c

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/java-sdk-release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ jobs:
2020
with:
2121
java-version: "11"
2222
distribution: "adopt"
23+
- name: Set java release version env variable
24+
run: echo "JAVA_RELEASE_VERSION=$(echo ${{github.ref_name}} | cut -c 7-)" >> $GITHUB_ENV
2325
- name: Publish package
24-
run: mvn --batch-mode deploy --file pom.xml
26+
run: mvn --batch-mode deploy --file pom.xml -Drevision=$JAVA_RELEASE_VERSION
2527
env:
2628
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

java/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.microsoft.tunnels</groupId>
77
<artifactId>tunnels-java-sdk</artifactId>
8-
<version>0.1.0</version>
8+
<version>${revision}</version>
99

1010
<name>tunnels-java-sdk</name>
1111
<url>https://github.com/microsoft/tunnels</url>
@@ -15,6 +15,7 @@
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1616
<maven.compiler.source>11</maven.compiler.source>
1717
<maven.compiler.target>11</maven.compiler.target>
18+
<revision>0.1.0</revision>
1819
</properties>
1920

2021
<dependencies>

0 commit comments

Comments
 (0)