Skip to content

Commit

Permalink
New workflow for maven central release.
Browse files Browse the repository at this point in the history
  • Loading branch information
nullterminated committed Jan 4, 2025
1 parent 71a9fdc commit c34fd6e
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish package to the Maven Central Repository
on:
workflow_dispatch:
inputs:
branch:
description: "The branch to checkout when cutting the release."
required: true
default: "central"
releaseVersion:
description: "Default version to use when preparing a release."
required: true
default: "X.Y.Z"
developmentVersion:
description: "Default version to use for new local working copy."
required: true
default: "X.Y.Z-SNAPSHOT"
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Set up
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: maven
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Configure git user
run: |
git config user.name "Github Actions"
git config user.email "[email protected]"
- name: Publish package
run: mvn -P release --batch-mode release:prepare release:perform -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}
env:
MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}

0 comments on commit c34fd6e

Please sign in to comment.