goreleaser / goreleaser-cross

Docker image for Golang cross-compiling with CGO
MIT License
156 stars 26 forks source link

Passphrase environment variable #58

Open rootulp opened 1 year ago

rootulp commented 1 year ago

Context

Thanks for this awesome project! I'm successfully using goreleaser-cross to build binaries for multiple platforms with CGO support. Tangent: our project needs this because it uses hardware wallets (i.e. Ledger) that depend on CGO.

Problem

I'm encountering an issue with signing here. Copy + pasted below for convenience

  ⨯ release failed after 5m16s                       error=sign: gpg failed: exit status 2: gpg: signing failed: Inappropriate ioctl for device
gpg: signing failed: Inappropriate ioctl for device

make: *** [Makefile:183: prebuilt-binary] Error 1
Error: Process completed with exit code 2.

A quick ChatGPT search leads me to believe this is happening because the passphrase hasn't been plumbed through and the process is opening an interactive prompt to ask for the passphrase.

Proposal

Add an environment variable to plumb the passphrase through and provide it during the signing step in Goreleaser