Publish Release #1
Workflow file for this run
This file contains hidden or 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: Publish Release | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| publish-release: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: gradle/wrapper-validation-action@v2 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Ensure this isn't a -SNAPSHOT version | |
| run: | | |
| VERSION=$(./gradlew -q printVersion | tail -1) | |
| if [[ $VERSION == *"-SNAPSHOT" ]]; then | |
| echo "Cannot publish a SNAPSHOT version ($VERSION) as a release" | |
| exit 1 | |
| fi | |
| echo "Publishing version: $VERSION" | |
| - name: Assemble | |
| run: ./gradlew assemble | |
| - name: Check | |
| run: ./gradlew check | |
| - name: Publish Release | |
| run: ./gradlew publishToMavenCentral | |
| env: | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }} |