From 714116675bb61ca0e00fac912a9108471e4b0315 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Fortune Date: Mon, 21 Oct 2024 13:14:54 +0200 Subject: [PATCH] ci: update GitHub Action --- .github/workflows/java-publish.yml | 33 ++++++++++++++++-------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/java-publish.yml b/.github/workflows/java-publish.yml index 1f7de1e..7e2b9ee 100644 --- a/.github/workflows/java-publish.yml +++ b/.github/workflows/java-publish.yml @@ -1,4 +1,4 @@ -name: Compile and Deploy Java Api to Maven Central +name: Compile and Deploy Java API to Maven Central on: push: @@ -9,28 +9,31 @@ jobs: java-publish: runs-on: ubuntu-latest steps: - - name: Check out repository code from ${{ github.repository }}/${{ github.ref }} - uses: actions/checkout@v3 + - name: Check out repository code + uses: actions/checkout@v4 + - name: Set up JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '11' - distribution: 'adopt' - - name: Write gradle.properties - run: | - mkdir -p ~/.gradle - echo "${{ secrets.GRADLE_PROPERTIES }}" | base64 -d > ~/.gradle/gradle.properties - - name: Install gpg secret key + distribution: 'temurin' + server-id: ossrh + server-username: ${{ secrets.OSSRH_USERNAME }} + server-password: ${{ secrets.OSSRH_API_TOKEN }} + gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} + gpg-passphrase: ${{ secrets.OSSRH_GPG_SECRET_PASSWORD }} + + - name: Install GPG secret key run: | - cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import - gpg --pinentry-mode loopback --passphrase "${{ secrets.OSSRH_GPG_SECRET_PASSWORD }}" --export-secret-key 568FD16F857171A0EC6D2C40742C84722FD2B235 > ~/.gradle/maven-central.gpg + echo "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 -d | gpg --batch --import + gpg --pinentry-mode loopback --passphrase "${{ secrets.OSSRH_GPG_SECRET_PASSWORD }}" --export-secret-keys > ~/.gradle/maven-central.gpg gpg --list-secret-keys --keyid-format LONG + - name: Update permissions - working-directory: . run: chmod +x ./gradlew ./.github/scripts/*.sh + - name: Check version - working-directory: . run: ./.github/scripts/check_version.sh + - name: Build and Publish - working-directory: . run: ./gradlew build test publish --info --stacktrace