Skip to content

Commit

Permalink
gradle, build and sign artifacts in 2 steps
Browse files Browse the repository at this point in the history
release is not from windows 2019, daemon can be used
  • Loading branch information
soloturn committed Feb 11, 2022
1 parent ad222cc commit 8603c8d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/ci-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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}"
Expand Down

0 comments on commit 8603c8d

Please sign in to comment.