1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-09 13:36:56 +02:00

fix: artifacts.json when type is archive (#2748)

* fix: artifacts.json when type is archive

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* test: fix scoop test

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker 2021-12-07 21:52:35 -03:00 committed by GitHub
parent 395266bb9b
commit 87a1ac21d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View File

@ -24,7 +24,7 @@ type Type int
const (
// UploadableArchive a tar.gz/zip archive to be uploaded.
UploadableArchive Type = iota
UploadableArchive Type = iota + 1
// UploadableBinary is a binary file to be uploaded.
UploadableBinary
// UploadableFile is any file that can be uploaded.

View File

@ -501,6 +501,13 @@ func TestMarshalJSON(t *testing.T) {
ExtraID: "adsad",
},
})
artifacts.Add(&Artifact{
Name: "foo",
Type: UploadableArchive,
Extra: map[string]interface{}{
ExtraID: "adsad",
},
})
artifacts.Add(&Artifact{
Name: "foo",
Type: Checksum,

View File

@ -1 +1 @@
[{"name":"foo","type":"Binary","extra":{"ID":"adsad"}},{"name":"foo","type":"Checksum","extra":{"Refresh":"func() error"}}]
[{"name":"foo","type":"Binary","extra":{"ID":"adsad"}},{"name":"foo","type":"Archive","extra":{"ID":"adsad"}},{"name":"foo","type":"Checksum","extra":{"Refresh":"func() error"}}]

View File

@ -624,6 +624,7 @@ func Test_doRun(t *testing.T) {
ctx := tt.args.ctx
ctx.Artifacts = artifact.New()
for _, a := range tt.artifacts {
a.Type = artifact.UploadableArchive
ctx.Artifacts.Add(&a)
}
require.NoError(t, Pipe{}.Default(ctx))