How can I use GoReleaser to sign a binary with a GPG key that requires a passphrase

621 views Asked by At

So it looks like Terraform recommends this config for GoReleaser, when I looked at it, there's nothing that uses sign parameter or something, does it mean that every project that uses this GoReleaser config uses an open GPG key then?

GoReleaser does not support signing binaries with a GPG key that requires a passphrase.

source: https://www.terraform.io/docs/registry/providers/publishing.html

1

There are 1 answers

0
caarlos0 On

You can probably provide the password using the stdin property, e.g.:

signs:
  - artifacts: checksum
    args:
      - "--batch"
      - "--local-user"
      - "{{ .Env.GPG_FINGERPRINT }}"
      - "--output"
      - "${signature}"
      - "--detach-sign"
      - "${artifact}"
    stdin: '{{ .Env.GPG_PASSWORD }}'