Fix release version broken in merge from 1.6.x #918
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: Java CI | |
on: | |
push: | |
branches: | |
- 'master' | |
- '1.5.x' | |
- '1.6.x' | |
tags-ignore: | |
- '*.*' | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
name: Build for JDK ${{ matrix.java }} | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository }} | |
strategy: | |
matrix: | |
java: [ 11 ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Set up JDK ${{ matrix.java }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'corretto' | |
- name: Build with Gradle | |
run: ./gradlew build | |
release: | |
name: Publish artifacts | |
runs-on: ubuntu-latest | |
if: github.event_name != 'pull_request' | |
needs: build | |
env: | |
HAVE_NEEDED_DATA: ${{ secrets.signingKey != '' && secrets.signingPassword != '' && secrets.sonatypeUsername != '' && secrets.sonatypePassword != '' }} | |
steps: | |
- name: Validate publish secrets | |
if: ${{ env.HAVE_NEEDED_DATA != 'true' }} | |
run: | | |
echo "The secrets for publish are not set." | |
exit 0 | |
- uses: actions/checkout@v4 | |
if: ${{ env.HAVE_NEEDED_DATA == 'true' }} | |
- uses: actions/cache@v4 | |
if: ${{ env.HAVE_NEEDED_DATA == 'true' }} | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
if: ${{ env.HAVE_NEEDED_DATA == 'true' }} | |
with: | |
java-version: 11 | |
distribution: 'corretto' | |
- name: Publish with Gradle | |
if: ${{ env.HAVE_NEEDED_DATA == 'true' }} | |
run: ./gradlew -x test publish | |
env: | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.signingKey }} | |
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.signingPassword }} | |
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.sonatypeUsername }} | |
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.sonatypePassword }} |