From 2c9eed09d0d569c6644658dd503a1fca8c062e0a Mon Sep 17 00:00:00 2001 From: Vasiliy Kozlov Date: Fri, 30 Dec 2022 18:41:59 +0300 Subject: [PATCH] Enable signing releases --- .github/workflows/release.yml | 18 +++++++++--------- .goreleaser.yml | 24 ++++++++++++------------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1fd5b2ac..aaf7e8d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,14 +29,14 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.19 -# - -# name: Import GPG key -# id: import_gpg -# uses: crazy-max/ghaction-import-gpg@v5 -# with: -# # These secrets will need to be configured for the repository: -# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} -# passphrase: ${{ secrets.PASSPHRASE }} + - + name: Import GPG key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@v5 + with: + # These secrets will need to be configured for the repository: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2.8.1 @@ -44,6 +44,6 @@ jobs: version: latest args: release --rm-dist env: -# GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} # # GitHub sets this automatically GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml index 188684df..a456d917 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -35,18 +35,18 @@ archives: checksum: name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' algorithm: sha256 -#signs: -# - artifacts: checksum -# args: -# # if you are using this in a GitHub action or some other automated pipeline, you -# # need to pass the batch flag to indicate its not interactive. -# - "--batch" -# - "--local-user" -# - "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key -# - "--output" -# - "${signature}" -# - "--detach-sign" -# - "${artifact}" +signs: + - artifacts: checksum + args: + # if you are using this in a GitHub action or some other automated pipeline, you + # need to pass the batch flag to indicate its not interactive. + - "--batch" + - "--local-user" + - "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key + - "--output" + - "${signature}" + - "--detach-sign" + - "${artifact}" release: # If you want to manually examine the release before its live, uncomment this line: # draft: true