fix: use JVM 17 for Gradle lint (Gradle requires JVM 17+) #2
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: Release | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| check-release-tag: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Prepare tag | |
| id: prepare_tag | |
| continue-on-error: true | |
| run: | | |
| export TAG=v$(awk '/^version = / { gsub("\"", ""); print $3 }' build.gradle) | |
| echo "TAG=$TAG" >> $GITHUB_ENV | |
| export CHECK_TAG=$(git tag | grep $TAG) | |
| if [[ $CHECK_TAG ]]; then | |
| echo "Skipping because release tag already exists" | |
| exit 1 | |
| fi | |
| - name: Output | |
| id: release_output | |
| if: ${{ steps.prepare_tag.outcome == 'success' }} | |
| run: echo "tag=${{ env.TAG }}" >> $GITHUB_OUTPUT | |
| outputs: | |
| tag: ${{ steps.release_output.outputs.tag }} | |
| create-github-release: | |
| runs-on: ubuntu-latest | |
| needs: check-release-tag | |
| if: ${{ needs.check-release-tag.outputs.tag }} | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Prepare tag | |
| run: | | |
| export TAG=v$(awk '/^version = / { gsub("\"", ""); print $3 }' build.gradle) | |
| echo "TAG=$TAG" >> $GITHUB_ENV | |
| - name: Setup git | |
| run: | | |
| git config user.email "ci@sockudo.io" | |
| git config user.name "Sockudo CI" | |
| - name: Prepare description | |
| run: | | |
| csplit -s CHANGELOG.md "/##/" {1} | |
| cat xx01 > CHANGELOG.tmp | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.TAG }} | |
| name: ${{ env.TAG }} | |
| body_path: CHANGELOG.tmp | |
| draft: false | |
| prerelease: false | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: create-github-release | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 11 | |
| - uses: gradle/actions/setup-gradle@v4 | |
| - name: Publish to Maven Central | |
| run: ./gradlew publish | |
| env: | |
| ORG_GRADLE_PROJECT_maven.username: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| ORG_GRADLE_PROJECT_maven.password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_GPG_SIGNING_KEY }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.MAVEN_GPG_KEY_ID }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_GPG_KEY_PASSWORD }} |