feat: add support for signing archlinux packages#1065
Conversation
b1a4386 to
2cebadb
Compare
|
@Elara6331 Do you want to take a look at this? |
|
@caarlos0 Is there any chance to get this reviewed and merged? It's a very straight forward change |
caarlos0
left a comment
There was a problem hiding this comment.
looking good overall, a couple of comments though.
thanks for the PR 🙏🏻
| key, err := readSigningKey(keyFile, passphrase) | ||
| sig, err := PGPArmoredDetachSignWithKeyID(bytes.NewReader(data), keyFile, passphrase, hexKeyID) | ||
| if err != nil { | ||
| return nil, &nfpm.ErrSigningFailure{Err: err} |
There was a problem hiding this comment.
changing the error types returned is a breaking change. I don't think its really necessary...
There was a problem hiding this comment.
I didn't change the error type here. This is the helper function used as RPM signer that wraps the error. Maybe we should extract it to the RPM module?
| DefaultHash: crypto.SHA256, | ||
| }, | ||
| ); err != nil { | ||
| return nil, &nfpm.ErrSigningFailure{Err: err} |
|
Thanks! I'll go over it in the next few days |
3b0eeb6 to
62030db
Compare
Archlinux packages can now be signed with a detached PGP signature, producing a binary .sig file alongside the package — matching the format expected by pacman-key --verify. The signing reads back the finalized .pkg.tar.zst from disk via info.Target to avoid buffering the entire package in memory. The passphrase is taken from $NFPM_ARCHLINUX_PASSPHRASE with a fallback to $NFPM_PASSPHRASE, consistent with deb/rpm/apk. Also adds sign.PGPDetachedSignWithKeyID, a streaming variant of PGPSignerWithKeyID that accepts an io.Reader instead of []byte. See goreleaser#628
62030db to
4494ec6
Compare
|
@caarlos0 I rebased the branch, fixed your comments and the lint errors and added an acceptance test for signed Arch Linux packages |
Archlinux packages can now be signed with a detached PGP signature, producing a binary .sig file alongside the package — matching the format expected by pacman-key --verify.
The signing reads back the finalized .pkg.tar.zst from disk via info.Target to avoid buffering the entire package in memory. The passphrase is taken from $NFPM_ARCHLINUX_PASSPHRASE with a fallback to $NFPM_PASSPHRASE, consistent with deb/rpm/apk.
Also adds sign.PGPDetachedSignWithKeyID, a streaming variant of PGPSignerWithKeyID that accepts an io.Reader instead of []byte.
See #628