Use github tag for release version (fix) (#290) #37
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: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| check: | |
| uses: ./.github/workflows/check.yml | |
| publish: | |
| needs: check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
| - name: Set up JDK | |
| uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Validate Gradle wrapper | |
| uses: gradle/wrapper-validation-action@8d49e559aae34d3e0eb16cde532684bc9702762b # v1.0.6 | |
| - name: Build sourcesJar and javadocJar | |
| uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0 | |
| with: | |
| arguments: sourcesJar javadocJar | |
| - name: Get tag | |
| shell: bash | |
| id: get_tag | |
| run: | | |
| TAG=${GITHUB_REF#refs/tags/} | |
| echo "Github tag: $TAG" | |
| echo "gh_tag=${TAG#v}" >> "$GITHUB_OUTPUT" | |
| - name: Publish to MavenCentral | |
| uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0 | |
| with: | |
| arguments: publishMavenPublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository | |
| env: | |
| OSSRH_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
| OSSRH_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
| SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} | |
| SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} | |
| SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
| SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
| GH_TAG: "${{ steps.get_tag.outputs.gh_tag }}" |