Publish #33
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 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| ci: | |
| description: "CI pipeline name" | |
| required: false | |
| default: "ci.yml" | |
| jobs: | |
| Publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Inject slug/short variables | |
| uses: rlespinasse/github-slug-action@v5 | |
| - name: Check CI status | |
| id: check | |
| run: | | |
| output=$(curl -sSL -X GET -G -H "Accept: application/vnd.github.v3+json" -d "branch=${{ env.GITHUB_REF_NAME_SLUG }}" -d "event=push" https://api.github.com/repos/${{ github.repository }}/actions/workflows/${{ github.event.inputs.ci }}/runs | jq -r '.workflow_runs[0] | "\(.conclusion)"') | |
| echo "status=$output" >> "$GITHUB_OUTPUT" | |
| - name: Abort if CI not successful | |
| if: steps.check.outputs.status != 'success' | |
| run: | | |
| echo ${{ steps.check.outputs.status }} | |
| exit 1 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "temurin" | |
| java-version-file: ".java-version" | |
| - name: Publish to Maven Central | |
| env: | |
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_KEY_PASSPHRASE }} | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} | |
| run: | | |
| ./gradlew publishToMavenCentral --no-configuration-cache |