From 8603c8da91f050c698c141b8735d66edf778d94d Mon Sep 17 00:00:00 2001 From: soloturn Date: Fri, 11 Feb 2022 11:14:55 +0100 Subject: [PATCH] gradle, build and sign artifacts in 2 steps release is not from windows 2019, daemon can be used --- .github/workflows/ci-gradle.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-gradle.yml b/.github/workflows/ci-gradle.yml index 9c949f50c9a..92d94bedd05 100644 --- a/.github/workflows/ci-gradle.yml +++ b/.github/workflows/ci-gradle.yml @@ -78,8 +78,6 @@ jobs: os: ubuntu-20.04 java_version: 8 runs-on: ${{ matrix.os }} - env: - SIGN_ARTIFACTS: ${{ secrets.ARTIFACT_SIGNING_KEY != '' }} steps: - name: Checkout the repository uses: actions/checkout@v2 @@ -101,6 +99,10 @@ jobs: # The repeated "matrix.release_from_this_build" checks are messy, but I have not found a simple way to avoid them # See https://github.com/actions/runner/issues/662 + - name: Create artifacts + if: matrix.release_from_this_build + run: gradle -q build -x test + - name: Setup gpg if: matrix.release_from_this_build && env.ARTIFACT_SIGNING_KEY id: gpg @@ -114,14 +116,13 @@ jobs: key_id="$(echo "${ARTIFACT_SIGNING_KEY}" | gpg --batch --show-keys --with-colons | awk -F: '$1 == "sec" { print $5 }')" echo "::set-output name=key_id::${key_id}" - - name: Create artifacts - if: matrix.release_from_this_build + - name: Sign artifacts + if: matrix.release_from_this_build && env.ARTIFACT_SIGNING_KEY env: GPG_KEYNAME: ${{ steps.gpg.outputs.key_id }} GPG_PASSPHRASE: ${{ secrets.ARTIFACT_SIGNING_PASSPHRASE }} run: | gradle sign "-Pversion=${POM_VERSION}"\ - "--no-daemon" \ "-Psigning.gnupg.keyName=${GPG_KEYNAME}" \ "-Psigning.gnupg.passphrase=${GPG_PASSPHRASE}"