mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-04-17 12:06:50 +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/ids"
|
||||||
"github.com/goreleaser/goreleaser/internal/pipe"
|
"github.com/goreleaser/goreleaser/internal/pipe"
|
||||||
"github.com/goreleaser/goreleaser/internal/semerrgroup"
|
"github.com/goreleaser/goreleaser/internal/semerrgroup"
|
||||||
|
"github.com/goreleaser/goreleaser/internal/skips"
|
||||||
"github.com/goreleaser/goreleaser/internal/tmpl"
|
"github.com/goreleaser/goreleaser/internal/tmpl"
|
||||||
"github.com/goreleaser/goreleaser/internal/yaml"
|
"github.com/goreleaser/goreleaser/internal/yaml"
|
||||||
"github.com/goreleaser/goreleaser/pkg/config"
|
"github.com/goreleaser/goreleaser/pkg/config"
|
||||||
@ -104,8 +105,10 @@ type Pipe struct{}
|
|||||||
|
|
||||||
func (Pipe) String() string { return "snapcraft packages" }
|
func (Pipe) String() string { return "snapcraft packages" }
|
||||||
func (Pipe) ContinueOnError() bool { return true }
|
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) 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.
|
// Default sets the pipe defaults.
|
||||||
func (Pipe) Default(ctx *context.Context) error {
|
func (Pipe) Default(ctx *context.Context) error {
|
||||||
|
@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/goreleaser/goreleaser/internal/artifact"
|
"github.com/goreleaser/goreleaser/internal/artifact"
|
||||||
"github.com/goreleaser/goreleaser/internal/gio"
|
"github.com/goreleaser/goreleaser/internal/gio"
|
||||||
"github.com/goreleaser/goreleaser/internal/pipe"
|
"github.com/goreleaser/goreleaser/internal/pipe"
|
||||||
|
"github.com/goreleaser/goreleaser/internal/skips"
|
||||||
"github.com/goreleaser/goreleaser/internal/testctx"
|
"github.com/goreleaser/goreleaser/internal/testctx"
|
||||||
"github.com/goreleaser/goreleaser/internal/testlib"
|
"github.com/goreleaser/goreleaser/internal/testlib"
|
||||||
"github.com/goreleaser/goreleaser/internal/yaml"
|
"github.com/goreleaser/goreleaser/internal/yaml"
|
||||||
@ -678,6 +679,7 @@ func Test_isValidArch(t *testing.T) {
|
|||||||
func TestSkip(t *testing.T) {
|
func TestSkip(t *testing.T) {
|
||||||
t.Run("skip", func(t *testing.T) {
|
t.Run("skip", func(t *testing.T) {
|
||||||
require.True(t, Pipe{}.Skip(testctx.New()))
|
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) {
|
t.Run("dont skip", func(t *testing.T) {
|
||||||
|
@ -24,6 +24,7 @@ const (
|
|||||||
Docker Key = "docker"
|
Docker Key = "docker"
|
||||||
Before Key = "before"
|
Before Key = "before"
|
||||||
Winget Key = "winget"
|
Winget Key = "winget"
|
||||||
|
Snapcraft Key = "snapcraft"
|
||||||
Scoop Key = "scoop"
|
Scoop Key = "scoop"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -100,6 +101,7 @@ var Release = Keys{
|
|||||||
Ko,
|
Ko,
|
||||||
Docker,
|
Docker,
|
||||||
Winget,
|
Winget,
|
||||||
|
Snapcraft,
|
||||||
Scoop,
|
Scoop,
|
||||||
Before,
|
Before,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user