Fix github publish flow #43
Workflow file for this run
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 to MavenCentral | |
on: | |
push: | |
tags: | |
- '*' | |
# Cancel previous runs of this workflow on new commits | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
publish: | |
name: Release build and publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Set version | |
run: | | |
echo "version=\"${{ github.ref_name }}\"" >> "$GITHUB_ENV" | |
# Builds the release artifacts of the library | |
- name: Build with Gradle | |
uses: gradle/gradle-build-action@v3 | |
with: | |
arguments: build | |
env: | |
ORG_GRADLE_PROJECT_VERSION: ${{ env.version }} | |
# Publishes to the repository | |
- name: Publish to MavenCentral | |
run: | | |
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository | |
env: | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} | |
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
OSSRH_STAGING_PROFILE_ID: ${{ secrets.OSSRH_STAGING_PROFILE_ID }} | |
ORG_GRADLE_PROJECT_VERSION: ${{ env.version }} |