Release to Maven Central #298
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 }} | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.TOKEN_NAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.TOKEN_KEY }} | |
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/setup-gradle@v3.1.0 | |
with: | |
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
cache-read-only: true | |
- name: Publish | |
run: ./gradlew -DLibrariesOnly=true publishAllPublicationsToMavenCentral | |
- name: Close and release | |
if: inputs.close_and_release | |
run: ./gradlew -DLibrariesOnly=true releaseRepository --configuration-cache |