feat(release): sign checksums and publish an SBOM
Releases carry SHA256SUMS signed in the minisign format (prehashed Ed25519, the release tag as trusted comment) and an SPDX SBOM of the Go modules and the npm packages the frontend build bundles. internal/signing signs and verifies; the release keys are committed in release.pub and compiled in, so the self-updating agents can check their downloads. Without the RELEASE_SIGNING_KEY secret a release is published unsigned with a warning. Closes #34 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
d2d6bf9f44
commit
b1ca8eb19f
9 files changed
+676
-5
No files matched your search
+30
-1
@@ -5,6 +5,11 @@
|
||||
// release notes [-json] <tag> print the release notes of a tag, with
|
||||
// -json as the body of a Gitea release
|
||||
// release check <tag> fail unless tag is a valid release tag
|
||||
// release sbom <tag> <bin>... print the SPDX SBOM of a release
|
||||
// release sign <file> <tag> write file.minisig with the key in
|
||||
// RELEASE_SIGNING_KEY
|
||||
// release verify <file> check file.minisig against the release keys
|
||||
// release keygen <secret-file> create a signing key, print its public key
|
||||
//
|
||||
// Stable releases follow semantic versioning from the commits since the
|
||||
// last stable release: breaking changes move the major version (the minor
|
||||
@@ -21,7 +26,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
const usage = `usage: release next [stable|beta] | notes [-json] <tag> | check <tag>`
|
||||
const usage = `usage: release next [stable|beta] | notes [-json] <tag> | check <tag> | sbom <tag> <binary>... | sign <file> <tag> | verify <file> | keygen <secret-file>`
|
||||
|
||||
func main() {
|
||||
if err := run(os.Args[1:]); err != nil {
|
||||
@@ -97,6 +102,30 @@ func run(args []string) error {
|
||||
}
|
||||
_, err := parseVersion(args[1])
|
||||
return err
|
||||
case "sbom":
|
||||
if len(args) < 3 {
|
||||
return usageError{}
|
||||
}
|
||||
v, err := parseVersion(args[1])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return writeSBOM(v, args[2:])
|
||||
case "sign":
|
||||
if len(args) != 3 {
|
||||
return usageError{}
|
||||
}
|
||||
return signFile(args[1], args[2])
|
||||
case "verify":
|
||||
if len(args) != 2 {
|
||||
return usageError{}
|
||||
}
|
||||
return verifyFile(args[1])
|
||||
case "keygen":
|
||||
if len(args) != 2 {
|
||||
return usageError{}
|
||||
}
|
||||
return keygen(args[1])
|
||||
default:
|
||||
return usageError{}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user