Release to Maven Central #283
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
name: Release to Maven Central | |
on: | |
workflow_dispatch: | |
inputs: | |
close_and_release: | |
required: false | |
default: true | |
type: boolean | |
env: | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SIGNING_KEY }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SIGNING_PASSPHRASE }} | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} | |
jobs: | |
publish: | |
runs-on: macos-latest | |
steps: | |
- run: echo "Publishing to Maven Central..." | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/[email protected] | |
with: | |
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
cache-read-only: true | |
- name: Publish | |
run: ./gradlew publishAllPublicationsToMavenCentral | |
- name: Close and release | |
if: inputs.close_and_release | |
run: ./gradlew releaseRepository --configuration-cache |