OPA-SpringBoot => OPA Spring Boot SDK #21
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: "03 - Publish to Maven Central" | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- CHANGELOG.md | |
jobs: | |
publish: | |
name: Publish Java SDK | |
runs-on: ubuntu-latest | |
steps: | |
- name: Tune GitHub-hosted runner network | |
uses: smorimoto/tune-github-hosted-runner-network@v1 | |
- uses: actions/checkout@v4 | |
- run: ./scripts/is_release.sh # fail the build if unreleased changes | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "17" | |
distribution: "corretto" | |
cache: "gradle" | |
- uses: gradle/actions/setup-gradle@v3 | |
- name: Publish to Sonatype (legacy) | |
run: |- | |
pwd | |
./gradlew publish --no-daemon | |
env: | |
MAVEN_USERNAME: ${{ secrets.ossrh_username }} | |
MAVEN_PASSWORD: ${{ secrets.ossrh_password }} | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.java_gpg_secret_key }} | |
ORG_GRADLE_PROJECT_signingPassphrase: ${{ secrets.java_gpg_passphrase }} | |
- uses: ravsamhq/notify-slack-action@v2 | |
if: always() && env.SLACK_WEBHOOK_URL != '' | |
with: | |
status: ${{ job.status }} | |
token: ${{ secrets.github_access_token }} | |
notify_when: "failure" | |
notification_title: "Failed to Publish Maven Central Release" | |
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>" | |
footer: "Linked Repo <{repo_url}|{repo}> | <{run_url}|View Run>" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |