diff --git a/pipeline/release/doc.go b/pipeline/release/doc.go new file mode 100644 index 000000000..b6e2a9d5c --- /dev/null +++ b/pipeline/release/doc.go @@ -0,0 +1,3 @@ +// Package release implements Pipe and manages github releases and its +// artifacts. +package release diff --git a/pipeline/release/release.go b/pipeline/release/release.go index 0924c22c1..ea972ddf3 100644 --- a/pipeline/release/release.go +++ b/pipeline/release/release.go @@ -1,5 +1,3 @@ -// Package release implements Pipe and manages github releases and its -// artifacts. package release import ( @@ -69,6 +67,7 @@ func doRun(ctx *context.Context, c client.Client) error { artifact.ByType(artifact.UploadableBinary), artifact.ByType(artifact.Checksum), artifact.ByType(artifact.Signature), + artifact.ByType(artifact.LinuxPackage), ), ).List() { sem <- true diff --git a/pipeline/release/release_test.go b/pipeline/release/release_test.go index 6f2bd37c9..5d99a4bbd 100644 --- a/pipeline/release/release_test.go +++ b/pipeline/release/release_test.go @@ -10,6 +10,7 @@ import ( "github.com/goreleaser/goreleaser/config" "github.com/goreleaser/goreleaser/context" + "github.com/goreleaser/goreleaser/internal/artifact" "github.com/goreleaser/goreleaser/internal/testlib" "github.com/stretchr/testify/assert" ) @@ -37,8 +38,16 @@ func TestRunPipe(t *testing.T) { var ctx = context.New(config) ctx.Git = context.GitInfo{CurrentTag: "v1.0.0"} ctx.Publish = true - ctx.AddArtifact(tarfile.Name()) - ctx.AddArtifact(debfile.Name()) + ctx.Artifacts.Add(artifact.Artifact{ + Type: artifact.UploadableArchive, + Name: "bin.tar.gz", + Path: tarfile.Name(), + }) + ctx.Artifacts.Add(artifact.Artifact{ + Type: artifact.LinuxPackage, + Name: "bin.deb", + Path: debfile.Name(), + }) client := &DummyClient{} assert.NoError(t, doRun(ctx, client)) assert.True(t, client.CreatedRelease) @@ -79,7 +88,11 @@ func TestRunPipeWithFileThatDontExist(t *testing.T) { var ctx = context.New(config) ctx.Git = context.GitInfo{CurrentTag: "v1.0.0"} ctx.Publish = true - ctx.AddArtifact("this-file-wont-exist-hopefully") + ctx.Artifacts.Add(artifact.Artifact{ + Type: artifact.UploadableArchive, + Name: "bin.tar.gz", + Path: "/nope/nope/nope", + }) client := &DummyClient{} assert.Error(t, doRun(ctx, client)) assert.True(t, client.CreatedRelease) @@ -102,7 +115,11 @@ func TestRunPipeUploadFailure(t *testing.T) { var ctx = context.New(config) ctx.Git = context.GitInfo{CurrentTag: "v1.0.0"} ctx.Publish = true - ctx.AddArtifact(tarfile.Name()) + ctx.Artifacts.Add(artifact.Artifact{ + Type: artifact.UploadableArchive, + Name: "bin.tar.gz", + Path: tarfile.Name(), + }) client := &DummyClient{ FailToUpload: true, }