-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d26f9c
commit 3043d1b
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: deploy-to-maven-central | ||
on: | ||
workflow_dispatch | ||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Java 21 | ||
uses: actions/setup-java@v4 # Does also set up Maven and GPG | ||
with: | ||
distribution: 'temurin' | ||
java-package: 'jdk' | ||
java-version: '21' | ||
check-latest: true | ||
server-id: 'central' # must match the serverId configured for the nexus-staging-maven-plugin | ||
server-username: CENTRAL_USERNAME # Env var that holds your central user name | ||
server-password: CENTRAL_TOKEN # Env var that holds your central user token | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Substituted with the value stored in the referenced secret | ||
gpg-passphrase: SIGN_KEY_PASS # Env var that holds the key's passphrase | ||
cache: 'maven' | ||
- name: Build & Deploy | ||
run: | | ||
# -U force updates just to make sure we are using latest dependencies | ||
# -B Batch mode (do not ask for user input), just in case | ||
# -P activate profile | ||
mvn -U -B clean deploy -P release | ||
env: | ||
SIGN_KEY_PASS: ${{ secrets.GPG_KEY_PASSPHRASE }} | ||
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} | ||
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }} |