mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-13 13:48:40 +02:00
fix(chocolatey): skip publish is check by publish pipe (#4273)
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:
parent
a962e3b3cf
commit
da1d3f4fcf
@ -12,7 +12,6 @@ import (
|
|||||||
"github.com/caarlos0/log"
|
"github.com/caarlos0/log"
|
||||||
"github.com/goreleaser/goreleaser/internal/artifact"
|
"github.com/goreleaser/goreleaser/internal/artifact"
|
||||||
"github.com/goreleaser/goreleaser/internal/client"
|
"github.com/goreleaser/goreleaser/internal/client"
|
||||||
"github.com/goreleaser/goreleaser/internal/pipe"
|
|
||||||
"github.com/goreleaser/goreleaser/internal/tmpl"
|
"github.com/goreleaser/goreleaser/internal/tmpl"
|
||||||
"github.com/goreleaser/goreleaser/pkg/config"
|
"github.com/goreleaser/goreleaser/pkg/config"
|
||||||
"github.com/goreleaser/goreleaser/pkg/context"
|
"github.com/goreleaser/goreleaser/pkg/context"
|
||||||
@ -78,10 +77,6 @@ func (Pipe) Run(ctx *context.Context) error {
|
|||||||
|
|
||||||
// Publish packages.
|
// Publish packages.
|
||||||
func (Pipe) Publish(ctx *context.Context) error {
|
func (Pipe) Publish(ctx *context.Context) error {
|
||||||
if ctx.SkipPublish {
|
|
||||||
return pipe.ErrSkipPublishEnabled
|
|
||||||
}
|
|
||||||
|
|
||||||
artifacts := ctx.Artifacts.Filter(
|
artifacts := ctx.Artifacts.Filter(
|
||||||
artifact.ByType(artifact.PublishableChocolatey),
|
artifact.ByType(artifact.PublishableChocolatey),
|
||||||
).List()
|
).List()
|
||||||
|
@ -220,11 +220,6 @@ func TestPublish(t *testing.T) {
|
|||||||
skip bool
|
skip bool
|
||||||
err string
|
err string
|
||||||
}{
|
}{
|
||||||
{
|
|
||||||
name: "skip publish",
|
|
||||||
skip: true,
|
|
||||||
err: "publishing is disabled",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "no artifacts",
|
name: "no artifacts",
|
||||||
},
|
},
|
||||||
@ -287,7 +282,7 @@ func TestPublish(t *testing.T) {
|
|||||||
cmd = stdCmd{}
|
cmd = stdCmd{}
|
||||||
})
|
})
|
||||||
|
|
||||||
ctx := testctx.New(func(ctx *context.Context) { ctx.SkipPublish = tt.skip })
|
ctx := testctx.New()
|
||||||
for _, artifact := range tt.artifacts {
|
for _, artifact := range tt.artifacts {
|
||||||
ctx.Artifacts.Add(&artifact)
|
ctx.Artifacts.Add(&artifact)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user