Release with Maven #6
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 with Maven | |
on: | |
workflow_dispatch: | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: '8' | |
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 "matomo-tracker@daniel-heid.de" | |
git config user.name "Daniel Heid" | |
- id: version | |
run: | | |
VERSION=$( mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout ) | |
echo "::set-output name=version::${VERSION#-SNAPSHOT}" | |
- uses: GabrielBB/xvfb-action@v1 | |
with: | |
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 }} |