Skip to content

Release with Maven

Release with Maven #22

Workflow file for this run

name: Release with Maven
on:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- run: |
git config user.email "[email protected]"
git config user.name "Matomo Java Tracker"
- id: version
run: |
VERSION=$( mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout )
echo "::set-output name=version::${VERSION%-SNAPSHOT}"
- run: mvn -B release:prepare release:perform
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- uses: release-drafter/release-drafter@v6
with:
version: ${{ steps.version.outputs.version }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}