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

fix(snapcrafts): skip publish is check by publish pipe (#4275)

the publish pipe, which runs all publishers, already skips all
publishers if skip publish is set, so this check is not needed here.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker 2023-09-04 16:20:36 -03:00 committed by GitHub
parent 8706fd2e89
commit a962e3b3cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 19 deletions

View File

@ -210,9 +210,6 @@ func isValidArch(arch string) bool {
// Publish packages.
func (Pipe) Publish(ctx *context.Context) error {
if ctx.SkipPublish {
return pipe.ErrSkipPublishEnabled
}
snaps := ctx.Artifacts.Filter(artifact.ByType(artifact.PublishableSnapcraft)).List()
for _, snap := range snaps {
if err := push(ctx, snap); err != nil {

View File

@ -532,21 +532,6 @@ func TestPublish(t *testing.T) {
require.Contains(t, err.Error(), "failed to push nope.snap package")
}
func TestPublishSkip(t *testing.T) {
ctx := testctx.New(testctx.SkipPublish)
ctx.Artifacts.Add(&artifact.Artifact{
Name: "mybin",
Path: "nope.snap",
Goarch: "amd64",
Goos: "linux",
Type: artifact.PublishableSnapcraft,
Extra: map[string]interface{}{
releasesExtra: []string{"stable"},
},
})
testlib.AssertSkipped(t, Pipe{}.Publish(ctx))
}
func TestDefaultSet(t *testing.T) {
ctx := testctx.NewWithCfg(config.Project{
Snapcrafts: []config.Snapcraft{
@ -587,7 +572,6 @@ func Test_processChannelsTemplates(t *testing.T) {
},
Env: []string{"FOO=123"},
},
testctx.SkipPublish,
testctx.WithCommit("a1b2c3d4"),
testctx.WithCurrentTag("v1.0.0"),
testctx.WithSemver(1, 0, 0, ""),