diff --git a/internal/pipe/snapcraft/snapcraft.go b/internal/pipe/snapcraft/snapcraft.go index 7c6a436ee..07d633e2b 100644 --- a/internal/pipe/snapcraft/snapcraft.go +++ b/internal/pipe/snapcraft/snapcraft.go @@ -7,12 +7,13 @@ import ( "os" "os/exec" "path/filepath" - "reflect" "strings" "github.com/apex/log" + "github.com/pkg/errors" + "gopkg.in/yaml.v2" + "github.com/goreleaser/goreleaser/internal/artifact" - "github.com/goreleaser/goreleaser/internal/deprecate" "github.com/goreleaser/goreleaser/internal/ids" "github.com/goreleaser/goreleaser/internal/linux" "github.com/goreleaser/goreleaser/internal/pipe" @@ -20,8 +21,6 @@ import ( "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/config" "github.com/goreleaser/goreleaser/pkg/context" - "github.com/pkg/errors" - yaml "gopkg.in/yaml.v2" ) // ErrNoSnapcraft is shown when snapcraft cannot be found in $PATH @@ -67,12 +66,6 @@ func (Pipe) String() string { // Default sets the pipe defaults func (Pipe) Default(ctx *context.Context) error { - if len(ctx.Config.Snapcrafts) == 0 { - ctx.Config.Snapcrafts = append(ctx.Config.Snapcrafts, ctx.Config.Snapcraft) - if !reflect.DeepEqual(ctx.Config.Snapcraft, config.Snapcraft{}) { - deprecate.Notice("snapcraft") - } - } var ids = ids.New("snapcrafts") for i := range ctx.Config.Snapcrafts { var snap = &ctx.Config.Snapcrafts[i] diff --git a/internal/pipe/snapcraft/snapcraft_test.go b/internal/pipe/snapcraft/snapcraft_test.go index 389728f3f..5038250c1 100644 --- a/internal/pipe/snapcraft/snapcraft_test.go +++ b/internal/pipe/snapcraft/snapcraft_test.go @@ -326,6 +326,9 @@ func TestDefault(t *testing.T) { ID: "foo", }, }, + Snapcrafts: []config.Snapcraft{ + {}, + }, }) assert.NoError(t, Pipe{}.Default(ctx)) assert.Equal(t, defaultNameTemplate, ctx.Config.Snapcrafts[0].NameTemplate) @@ -357,16 +360,6 @@ func TestDefaultSet(t *testing.T) { assert.Equal(t, "foo", ctx.Config.Snapcrafts[0].NameTemplate) } -func TestDefaultDeprecate(t *testing.T) { - var ctx = context.New(config.Project{ - Snapcraft: config.Snapcraft{ - NameTemplate: "foo", - }, - }) - assert.NoError(t, Pipe{}.Default(ctx)) - assert.Equal(t, "foo", ctx.Config.Snapcrafts[0].NameTemplate) -} - func addBinaries(t *testing.T, ctx *context.Context, name, dist, dest string) { for _, goos := range []string{"linux", "darwin"} { for _, goarch := range []string{"amd64", "386", "arm6"} { diff --git a/pkg/config/config.go b/pkg/config/config.go index 6dd6a7252..79fd41160 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -361,7 +361,6 @@ type Project struct { Archive Archive `yaml:",omitempty"` // TODO: remove this Archives []Archive `yaml:",omitempty"` NFPMs []NFPM `yaml:"nfpms,omitempty"` - Snapcraft Snapcraft `yaml:",omitempty"` // TODO: remove this Snapcrafts []Snapcraft `yaml:",omitempty"` Snapshot Snapshot `yaml:",omitempty"` Checksum Checksum `yaml:",omitempty"` diff --git a/www/content/deprecations.md b/www/content/deprecations.md index 427235f53..d9442d4a9 100644 --- a/www/content/deprecations.md +++ b/www/content/deprecations.md @@ -175,29 +175,6 @@ blobs: # etc ``` -### snapcraft - -> since 2019-05-27 - -We now allow multiple Snapcraft configs, so the `snapcraft` statement will be removed. - -Change this: - -```yaml -snapcraft: - publish: true - # ... -``` - -to this: - -```yaml -snapcrafts: - - - publish: true - # ... -``` - ### archive > since 2019-04-16 @@ -223,6 +200,30 @@ archives: The following options were deprecated for ~6 months and are now fully removed. + +### snapcraft + +> since 2019-05-27, removed 2019-12-27 + +We now allow multiple Snapcraft configs, so the `snapcraft` statement will be removed. + +Change this: + +```yaml +snapcraft: + publish: true + # ... +``` + +to this: + +```yaml +snapcrafts: + - + publish: true + # ... +``` + ### nfpm > since 2019-05-07, removed 2019-12-27