mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-04-13 11:50:34 +02:00
feat: --skip=snapcraft
This commit is contained in:
parent
c6cb980c4f
commit
1a8702f140
@ -17,6 +17,7 @@ import (
|
||||
"github.com/goreleaser/goreleaser/internal/ids"
|
||||
"github.com/goreleaser/goreleaser/internal/pipe"
|
||||
"github.com/goreleaser/goreleaser/internal/semerrgroup"
|
||||
"github.com/goreleaser/goreleaser/internal/skips"
|
||||
"github.com/goreleaser/goreleaser/internal/tmpl"
|
||||
"github.com/goreleaser/goreleaser/internal/yaml"
|
||||
"github.com/goreleaser/goreleaser/pkg/config"
|
||||
@ -104,8 +105,10 @@ type Pipe struct{}
|
||||
|
||||
func (Pipe) String() string { return "snapcraft packages" }
|
||||
func (Pipe) ContinueOnError() bool { return true }
|
||||
func (Pipe) Skip(ctx *context.Context) bool { return len(ctx.Config.Snapcrafts) == 0 }
|
||||
func (Pipe) Dependencies(_ *context.Context) []string { return []string{"snapcraft"} }
|
||||
func (Pipe) Skip(ctx *context.Context) bool {
|
||||
return skips.Any(ctx, skips.Snapcraft) || len(ctx.Config.Snapcrafts) == 0
|
||||
}
|
||||
|
||||
// Default sets the pipe defaults.
|
||||
func (Pipe) Default(ctx *context.Context) error {
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
"github.com/goreleaser/goreleaser/internal/artifact"
|
||||
"github.com/goreleaser/goreleaser/internal/gio"
|
||||
"github.com/goreleaser/goreleaser/internal/pipe"
|
||||
"github.com/goreleaser/goreleaser/internal/skips"
|
||||
"github.com/goreleaser/goreleaser/internal/testctx"
|
||||
"github.com/goreleaser/goreleaser/internal/testlib"
|
||||
"github.com/goreleaser/goreleaser/internal/yaml"
|
||||
@ -678,6 +679,7 @@ func Test_isValidArch(t *testing.T) {
|
||||
func TestSkip(t *testing.T) {
|
||||
t.Run("skip", func(t *testing.T) {
|
||||
require.True(t, Pipe{}.Skip(testctx.New()))
|
||||
require.True(t, Pipe{}.Skip(testctx.New(testctx.Skip(skips.Snapcraft))))
|
||||
})
|
||||
|
||||
t.Run("dont skip", func(t *testing.T) {
|
||||
|
@ -24,6 +24,7 @@ const (
|
||||
Docker Key = "docker"
|
||||
Before Key = "before"
|
||||
Winget Key = "winget"
|
||||
Snapcraft Key = "snapcraft"
|
||||
Scoop Key = "scoop"
|
||||
)
|
||||
|
||||
@ -100,6 +101,7 @@ var Release = Keys{
|
||||
Ko,
|
||||
Docker,
|
||||
Winget,
|
||||
Snapcraft,
|
||||
Scoop,
|
||||
Before,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user