Skip to content

Release

Release #1

Workflow file for this run

name: Release
on:
release:
types: [ created, published ]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE # Env var that holds the key's passphrase
- if: github.event.release
name: Update version in pom.xml (Release only)
run: mvn -B versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false
- name: Publish to the Maven Central Repository
run: mvn --no-transfer-progress --batch-mode deploy -DperformRelease=true
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME_OSSRH }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD_OSSRH }}
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"
GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: '{{ EVENT_PAYLOAD.repository.full_name }} version {{ EVENT_PAYLOAD.release.name }} is out!'