Publish SDK #17
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: Publish SDK | |
on: | |
workflow_run: | |
workflows: ["Create a new release tag"] | |
types: | |
- completed | |
jobs: | |
deploy-release: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags') | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout code | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
cache: gradle | |
- uses: burrunan/gradle-cache-action@v1 | |
name: Deploy Release to Maven central | |
env: | |
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} | |
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }} | |
ORG_GRADLE_PROJECT_signingPassphrase: ${{ secrets.GPG_PASSPHRASE }} | |
with: | |
job-id: release | |
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository | |
- name: Create Github release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }} |