update version #3
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 Release | |
on: | |
push: | |
branches: | |
- 'wip-[0-9]+.[0-9]+' | |
- '[0-9]+.[0-9]+' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install gpg secret key | |
run: | | |
cat <(echo -e "${{ secrets.GPG_SECRET_KEY }}") | gpg2 --batch --import | |
gpg2 --list-secret-keys --keyid-format LONG | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: zulu | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Build and Test | |
run: ./gradlew clean check | |
- name: Publish WIP to Github Packages | |
if: ${{ contains( github.ref, 'wip-' ) }} | |
env: | |
GRADLE_OPTS: -Dbuild.number=${{ github.run_number }} -Dbuild.vcs.number=${{ github.sha }} -Dbuild.vcs.branch=${{ github.ref }} | |
GPR_USERNAME: ${{ github.actor }} | |
GPR_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: ./gradlew publishAllPublicationsToGitHubPackagesRepository -Psigning.gnupg.keyName=${{ secrets.GPG_SECRET_KEY_ID }} -Psigning.gnupg.passphrase=${{ secrets.GPG_SECRET_KEY_PASSWORD }} | |
- name: Publish Release to Maven Central | |
if: ${{ !contains( github.ref, 'wip-' ) }} | |
env: | |
GRADLE_OPTS: -Dbuild.number=${{ github.run_number }} -Dbuild.vcs.number=${{ github.sha }} -Dbuild.vcs.branch=${{ github.ref }} | |
MCR_USERNAME: ${{ secrets.MCR_USERNAME }} | |
MCR_PASSWORD: ${{ secrets.MCR_PASSWORD }} | |
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -Psigning.gnupg.keyName=${{ secrets.GPG_SECRET_KEY_ID }} -Psigning.gnupg.passphrase=${{ secrets.GPG_SECRET_KEY_PASSWORD }} |