ci: add java distribution to actions/setup-java@v4 #10
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 snapshot | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 11 | |
distribution: 'temurin' | |
- name: Check version is snapshot | |
run: | | |
PROJECT_VERSION=$(./gradlew -q printVersion | tail -n 1) | |
echo "Project version is $PROJECT_VERSION" | |
if [[ "$PROJECT_VERSION" != *"SNAPSHOT" ]]; then exit 1; fi | |
- name: Decrypt large secret | |
run: | | |
chmod +x ./.github/workflows/decrypt_secret.sh | |
./.github/workflows/decrypt_secret.sh | |
env: | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Build | |
run: ./gradlew build | |
- name: Publish | |
run: ./gradlew publish -PossrhUrl="$PUBLISH_SNAPSHOT_REPO_URL" -PossrhUsername="$PUBLISH_REPO_USERNAME" -PossrhPassword="$PUBLISH_REPO_PASSWORD" -Psigning.keyId="$GPG_KEY_ID" -Psigning.password="$GPG_PASSPHRASE" -Psigning.secretKeyRingFile="$SIGN_FILE_PATH" | |
env: | |
PUBLISH_SNAPSHOT_REPO_URL: https://oss.sonatype.org/content/repositories/snapshots/ | |
PUBLISH_REPO_USERNAME: ${{ secrets.SONATYPE_OSS_USERNAME }} | |
PUBLISH_REPO_PASSWORD: ${{ secrets.SONATYPE_OSS_PASSWORD }} | |
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
SIGN_FILE_PATH: "${{ github.workspace }}/.github/workflows/jcv_sign.gpg" |