Skip to content

feat: integrate JReleaser for automated releases #1

feat: integrate JReleaser for automated releases

feat: integrate JReleaser for automated releases #1

Workflow file for this run

name: Build
on:
push:
tags:
- 'v*'
branches:
- 'feat/jreleaser'
jobs:
build:
name: "Release new version and publish to the Maven Central Repository"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup java
uses: actions/setup-java@v4
with:
java-version: 17
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.current_version.outputs.release_version }}
- 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_USERNAME }}
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
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
- 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
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: Set next development version
tags: true