Skip to content

Commit

Permalink
fix(jreleaser): update POM files and GitHub Actions workflow
Browse files Browse the repository at this point in the history
- Update parent version properties in POM files to use `${revision}${changelist}`
- Simplify GitHub Actions workflow for JReleaser by removing redundant steps and directly setting the release version
  • Loading branch information
f-lopes committed Sep 27, 2024
1 parent 467774e commit 162a86b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 18 deletions.
16 changes: 1 addition & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@ jobs:
distribution: 'temurin'
cache: maven

- name: Retrieve release version from tag
id: retrieve_release_version
run: release_version=${GITHUB_REF_NAME#v}; echo "release_version=$release_version" >> "$GITHUB_OUTPUT"

- name: Set release version
id: set_release_version
run: mvn -B versions:set -DnewVersion=${{ steps.retrieve_release_version.outputs.release_version }} && mvn help:evaluate -Dexpression=project.version -q -DforceStdout

- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: Perform release ${{ github.event.inputs.version }}

- name: Release to Maven Central
env:
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME }}
Expand All @@ -46,7 +32,7 @@ jobs:
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn -B -pl spring-mvc-test-utils -Prelease jreleaser:deploy
run: mvn -B -Dchangelist= -pl spring-mvc-test-utils -Prelease jreleaser:deploy

- name: Set next development version
run: mvn -B build-helper:parse-version versions:set-property -Dproperty=revision -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} versions:commit
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.florianlopes</groupId>
<artifactId>spring-mvc-test-utils-parent</artifactId>
<version>0.0.0</version>
<version>${revision}${changelist}</version>
<packaging>pom</packaging>

<name>spring-mvc-test-utils-parent</name>
Expand Down
2 changes: 1 addition & 1 deletion smoke-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.florianlopes</groupId>
<artifactId>spring-mvc-test-utils-parent</artifactId>
<version>0.0.0</version>
<version>${revision}${changelist}</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion spring-mvc-test-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.florianlopes</groupId>
<artifactId>spring-mvc-test-utils-parent</artifactId>
<version>0.0.0</version>
<version>${revision}${changelist}</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down

0 comments on commit 162a86b

Please sign in to comment.