Skip to content

Commit

Permalink
ci: move gpg import into publish artifact step
Browse files Browse the repository at this point in the history
  • Loading branch information
tommytroen committed Feb 20, 2020
1 parent 42a55df commit a9ed168
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,10 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-wrapper-
- name: Import gpg key
env:
GPG_KEY_BASE64: ${{ secrets.GPG_KEY_BASE64 }}
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run:
export GPG_TTY=$(tty) && echo $GPG_KEY_BASE64 | base64 --decode | gpg --fast-import --batch

- name: Publish artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_KEY_BASE64: ${{ secrets.GPG_KEY_BASE64 }}
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
Expand All @@ -56,6 +49,7 @@ jobs:
# The GITHUB_REF tag comes in the format 'refs/tags/xxx'.
# So if we split on '/' and take the 3rd value, we can get the release name.
run: |
export GPG_TTY=$(tty) && echo ${GPG_KEY_BASE64} | base64 --decode | gpg --fast-import --batch
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
echo "New version: ${NEW_VERSION}"
./gradlew -Pversion=${NEW_VERSION} publish
Expand Down

0 comments on commit a9ed168

Please sign in to comment.