Skip to content

Publish package to the Maven Central Repository #3

Publish package to the Maven Central Repository

Publish package to the Maven Central Repository #3

Workflow file for this run

name: Publish package to the Maven Central Repository
on:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Publish packages
run: |
chmod +x ./gradlew
./gradlew jreleaserConfig
./gradlew clean
./gradlew publishAllPublicationsToLocalStagingRepository
./gradlew jreleaserFullRelease
env:
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.SIGNING_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.SIGNING_SECRET_KEY }}
JRELEASER_GPG_PASSPHRASE: "NONE"
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.NEXUS_USERNAME }}
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.NEXUS_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}