release #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseVersion: | |
description: "Default version to use when preparing a release." | |
required: true | |
default: "X.Y.Z" | |
nextDevelopVersion: | |
description: "Default version to use next after the release." | |
required: true | |
default: "X.Y.Z-SNAPSHOT" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
- name: Setup git user | |
uses: fregante/setup-git-user@v2 | |
- name: Set up JDK 21 and OSSRH auth / GPG signing | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "21" | |
distribution: "temurin" | |
cache: "maven" | |
server-id: "central" | |
server-username: CENTRAL_USERNAME | |
server-password: CENTRAL_PASSWORD | |
gpg-private-key: ${{ secrets.gpg_private_key }} | |
gpg-passphrase: SIGN_KEY_PASS | |
- name: Run all Tests | |
run: mvn install | |
- name: Perform maven release | |
run: > | |
mvn -B -ntp release:prepare release:perform \ | |
-DreleaseVersion=${{ github.event.inputs.releaseVersion }} \ | |
-DdevelopmentVersion=${{ github.event.inputs.nextDevelopVersion }} \ | |
-Dtag=${{ github.event.inputs.releaseVersion }} \ | |
-Darguments="-DskipTests" | |
env: | |
SIGN_KEY_PASS: ${{ secrets.gpg_passphrase }} | |
CENTRAL_USERNAME: ${{ secrets.sonatype_username }} | |
CENTRAL_PASSWORD: ${{ secrets.sonatype_password }} | |
- name: Create GitHub Release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ github.event.inputs.releaseVersion }} | |
draft: false | |
prerelease: false | |
generate_release_notes: true | |
- name: Update files | |
uses: MathieuSoysal/[email protected] | |
with: | |
files: README.md # List of files to update | |
prefix: "<version>" # Prefix before the version, default is: "" | |
with-checkout: false # If you don't want to checkout the repo, default is: true | |
- name: Push changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
committer_name: GitHub Actions | |
committer_email: [email protected] | |
add: . | |
message: ':bookmark: (readme) new maven release' | |