Skip to content

[maven-release-plugin] prepare release v7.3.0 #53

[maven-release-plugin] prepare release v7.3.0

[maven-release-plugin] prepare release v7.3.0 #53

Workflow file for this run

# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Release
on:
push:
tags:
- v7*
jobs:
build:
concurrency: release
name: Release to Maven Central
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
check-latest: true
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
settings-path: ${{ github.workspace }}
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-
- name: Build with Maven
run: >
mvn
--show-version
--batch-mode
--no-transfer-progress
--activate-profiles release
--file pom.xml
--settings $GITHUB_WORKSPACE/settings.xml
clean
compile
test-compile
- name: Verify with Maven
run: >
mvn
--show-version
--batch-mode
--no-transfer-progress
--activate-profiles release
--file pom.xml
--settings $GITHUB_WORKSPACE/settings.xml
verify
env:
SIGN_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
SIGN_KEY_PASS: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Publish to Maven Central
run: >
mvn
--show-version
--batch-mode
--no-transfer-progress
--activate-profiles release
--file pom.xml
--settings $GITHUB_WORKSPACE/settings.xml
deploy
-DskipTests
-Dmaven.install.skip=true
env:
SIGN_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
SIGN_KEY_PASS: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_OPTS: "--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
- name: Create an automatic release
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
prerelease: false
publish: true
latest: true
version: ${{ github.ref_name }}