Skip to content

Commit dc81202

Browse files
github action to update version and revert changes to the POM
1 parent f537e98 commit dc81202

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

.github/workflows/maven-publish.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010

1111
jobs:
1212
build:
13-
1413
runs-on: ubuntu-latest
1514
permissions:
1615
contents: write
@@ -24,8 +23,11 @@ jobs:
2423
with:
2524
java-version: '17'
2625
distribution: 'temurin'
27-
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
28-
settings-path: ${{ github.workspace }} # location for the settings.xml file
26+
server-id: github
27+
settings-path: ${{ github.workspace }}
28+
29+
- name: Set Maven Version
30+
run: mvn versions:set -DnewVersion=${{ github.ref_name }}
2931

3032
- name: Build with Maven
3133
run: mvn -B -U -DskipTests clean package --file pom.xml
@@ -39,15 +41,17 @@ jobs:
3941
draft: false
4042
prerelease: false
4143
env:
42-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
4446
- name: Upload JAR to Release
4547
uses: actions/upload-release-asset@v1
4648
with:
4749
upload_url: ${{ steps.create_release.outputs.upload_url }}
48-
asset_path: target/python-generator-0.0.0.main-SNAPSHOT.jar
50+
asset_path: target/python-generator-${{ github.ref_name }}.jar
4951
asset_name: python-generator-${{ github.ref_name }}.jar
5052
asset_content_type: application/java-archive
5153
env:
52-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53-
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: Reset POM
57+
run: git checkout -- pom.xml

pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<groupId>com.regnosys.rosetta.code-generators</groupId>
1515
<artifactId>python-generator</artifactId>
16-
<version>${project.version}</version>
16+
<version>0.0.0.main-SNAPSHOT</version>
1717
<packaging>jar</packaging>
1818
<name>code-gen-python</name>
1919

@@ -148,7 +148,6 @@
148148
</profiles>
149149

150150
<properties>
151-
<project.version>0.0.0.main-SNAPSHOT</project.version>
152151
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
153152
<java.enforced.version>[17,18)</java.enforced.version>
154153
<maven.compiler.release>11</maven.compiler.release>

0 commit comments

Comments
 (0)