mirror of
https://github.com/goreleaser/goreleaser.git
synced 2024-12-27 01:33:39 +02:00
parent
39e62beadc
commit
f3fce3df5b
@ -17,6 +17,7 @@ import (
|
||||
"github.com/goreleaser/goreleaser/v2/internal/artifact"
|
||||
"github.com/goreleaser/goreleaser/v2/internal/ids"
|
||||
"github.com/goreleaser/goreleaser/v2/internal/semerrgroup"
|
||||
"github.com/goreleaser/goreleaser/v2/internal/skips"
|
||||
"github.com/goreleaser/goreleaser/v2/internal/tmpl"
|
||||
"github.com/goreleaser/goreleaser/v2/pkg/archive"
|
||||
"github.com/goreleaser/goreleaser/v2/pkg/config"
|
||||
@ -44,6 +45,10 @@ func (Pipe) String() string {
|
||||
return "archives"
|
||||
}
|
||||
|
||||
func (Pipe) Skip(ctx *context.Context) bool {
|
||||
return skips.Any(ctx, skips.Archive)
|
||||
}
|
||||
|
||||
// Default sets the pipe defaults.
|
||||
func (Pipe) Default(ctx *context.Context) error {
|
||||
ids := ids.New("archives")
|
||||
|
@ -11,6 +11,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/goreleaser/goreleaser/v2/internal/artifact"
|
||||
"github.com/goreleaser/goreleaser/v2/internal/skips"
|
||||
"github.com/goreleaser/goreleaser/v2/internal/testctx"
|
||||
"github.com/goreleaser/goreleaser/v2/internal/testlib"
|
||||
"github.com/goreleaser/goreleaser/v2/pkg/archive"
|
||||
@ -1228,3 +1229,13 @@ func TestExtraFormatWhenOverride(t *testing.T) {
|
||||
archives := ctx.Artifacts.Filter(artifact.ByFormats("zip")).List()
|
||||
require.Len(t, archives, 1)
|
||||
}
|
||||
|
||||
func TestSkip(t *testing.T) {
|
||||
t.Run("skip", func(t *testing.T) {
|
||||
ctx := testctx.New(testctx.Skip(skips.Archive))
|
||||
require.True(t, Pipe{}.Skip(ctx))
|
||||
})
|
||||
t.Run("dont skip", func(t *testing.T) {
|
||||
require.False(t, Pipe{}.Skip(testctx.New()))
|
||||
})
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ const (
|
||||
NFPM Key = "nfpm"
|
||||
Chocolatey Key = "chocolatey"
|
||||
Notarize Key = "notarize"
|
||||
Archive Key = "archive"
|
||||
)
|
||||
|
||||
func String(ctx *context.Context) string {
|
||||
@ -116,6 +117,7 @@ var Release = Keys{
|
||||
NFPM,
|
||||
Before,
|
||||
Notarize,
|
||||
Archive,
|
||||
}
|
||||
|
||||
var Build = Keys{
|
||||
|
Loading…
Reference in New Issue
Block a user