Release with Maven #12
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@v3 | |
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@v5 | |
with: | |
version: ${{ steps.version.outputs.version }} | |
publish: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_USERNAME: github-actions | |
SLACK_ICON: https://m-img.org/spai/w_147+q_lossless+ret_img+to_webp/matomo.org/wp-content/uploads/2020/03/matomo-logo-winner-mobile3.png | |
SLACK_ICON_EMOJI: ':tada:' | |
SLACK_TITLE: Matomo Java Tracker ${{ steps.version.outputs.version }} released | |
SLACK_MESSAGE: "Exciting news! :star2: We're thrilled to share that a new version of the Matomo Java Tracker was staged and will become available soon, packed with awesome features and improvements. :rocket: See https://github.com/matomo-org/matomo-java-tracker/releases for release notes." | |
SLACK_FOOTER: "Thanks for being awesome! :heart:" |