1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-07-17 01:42:37 +02:00

feat: add metadata to the release (#4714)

this will create a metadata artifact and allow to add them to the
release.

closes #4669
closes #4682

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker
2024-03-26 23:41:41 -03:00
committed by GitHub
parent ec7106fdea
commit 2498ea7029
18 changed files with 169 additions and 36 deletions

View File

@ -36,6 +36,7 @@ func TestExecute(t *testing.T) {
{"archive", "tar", artifact.UploadableArchive},
{"ubinary", "ubi", artifact.UploadableBinary},
{"checksum", "sum", artifact.Checksum},
{"metadata", "json", artifact.Metadata},
{"signature", "sig", artifact.Signature},
{"signature", "pem", artifact.Certificate},
} {
@ -186,6 +187,30 @@ func TestExecute(t *testing.T) {
nil,
nil,
},
{
"include metadata",
[]config.Publisher{
{
Name: "test",
Meta: true,
Cmd: MockCmd + " {{ .ArtifactName }}",
Env: []string{
MarshalMockEnv(&MockData{
AnyOf: []MockCall{
{ExpectedArgs: []string{"a.deb"}, ExitCode: 0, ExpectedEnv: osEnv()},
{ExpectedArgs: []string{"a.ubi"}, ExitCode: 0, ExpectedEnv: osEnv()},
{ExpectedArgs: []string{"a.tar"}, ExitCode: 0, ExpectedEnv: osEnv()},
{ExpectedArgs: []string{"a.json"}, ExitCode: 0, ExpectedEnv: osEnv()},
{ExpectedArgs: []string{"foo/bar"}, ExitCode: 0, ExpectedEnv: osEnv()},
{ExpectedArgs: []string{"foo/bar:amd64"}, ExitCode: 0, ExpectedEnv: osEnv()},
},
}),
},
},
},
nil,
nil,
},
{
"include signatures",
[]config.Publisher{