From 55187e173fb4a2ac9b7fc319b5d5678eb071d696 Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Wed, 10 Feb 2021 01:53:00 +0100 Subject: [PATCH] Changes to workflows --- .github/workflows/release.yml | 14 +++++++------- .github/workflows/test.yml | 17 +++++++---------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c0ccb000..8666d381 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,17 +20,17 @@ jobs: go-version: 1.15 - name: Import the GPG signing key - env: - GPG_KEY: ${{ secrets.GPG_KEY }} - run: | - echo "$GPG_KEY" | base64 -d | gpg --batch --allow-secret-key-import --import - gpg --keyid-format LONG --list-secret-keys + id: import_gpg + uses: danitso/ghaction-import-gpg@v3 + with: + gpg-private-key: ${{ secrets.GPG_KEY } + passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Create release - uses: goreleaser/goreleaser-action@v2 + uses: danitso/goreleaser-action@v2 with: version: latest args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 23c851bf..adba6611 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,20 +22,17 @@ jobs: go-version: 1.15 - name: Import the GPG signing key - env: - GPG_KEY: ${{ secrets.GPG_KEY }} - run: | - GPG_TTY="$(tty)" - export GPG_TTY - - echo "$GPG_KEY" | base64 -d | gpg --batch --allow-secret-key-import --import - gpg --keyid-format LONG --list-secret-keys + id: import_gpg + uses: danitso/ghaction-import-gpg@v3 + with: + gpg-private-key: ${{ secrets.GPG_KEY } + passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Create release - uses: goreleaser/goreleaser-action@v2 + uses: danitso/goreleaser-action@v2 with: version: latest args: release --rm-dist --snapshot env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}