Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ on:
push:
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]

permissions:
contents: write
permissions: {}

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # create the GitHub release

steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false

- name: Check tag matches pom.xml and is on master
run: |
Expand All @@ -41,20 +43,25 @@ jobs:
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
# maven-gpg-plugin 3.2+ reads the passphrase from this variable
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Deploy to Maven Central
run: mvn -B clean deploy -P release
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Create GitHub release
# A draft: the Central deployment is published by hand, so the
# release is published once the artifacts are live
- name: Create GitHub draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "$GITHUB_REF_NAME" \
--repo "$GITHUB_REPOSITORY" \
--draft \
--verify-tag \
--title "${GITHUB_REF_NAME#v}" \
--generate-notes
Loading
Loading