You've already forked goreleaser
mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-11-06 09:09:29 +02:00
feat: deprecated changelog.skip in favor of changelog.disable
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
|||||||
|
|
||||||
"github.com/caarlos0/log"
|
"github.com/caarlos0/log"
|
||||||
"github.com/goreleaser/goreleaser/internal/client"
|
"github.com/goreleaser/goreleaser/internal/client"
|
||||||
|
"github.com/goreleaser/goreleaser/internal/deprecate"
|
||||||
"github.com/goreleaser/goreleaser/internal/git"
|
"github.com/goreleaser/goreleaser/internal/git"
|
||||||
"github.com/goreleaser/goreleaser/internal/tmpl"
|
"github.com/goreleaser/goreleaser/internal/tmpl"
|
||||||
"github.com/goreleaser/goreleaser/pkg/context"
|
"github.com/goreleaser/goreleaser/pkg/context"
|
||||||
@@ -43,7 +44,12 @@ func (Pipe) Skip(ctx *context.Context) (bool, error) {
|
|||||||
if ctx.Snapshot {
|
if ctx.Snapshot {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
return tmpl.New(ctx).Bool(ctx.Config.Changelog.Skip)
|
if ctx.Config.Changelog.Skip != "" {
|
||||||
|
deprecate.Notice(ctx, "changelog.skip")
|
||||||
|
ctx.Config.Changelog.Disable = ctx.Config.Changelog.Skip
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmpl.New(ctx).Bool(ctx.Config.Changelog.Disable)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run the pipe.
|
// Run the pipe.
|
||||||
|
|||||||
@@ -682,7 +682,7 @@ func TestSkip(t *testing.T) {
|
|||||||
require.True(t, b)
|
require.True(t, b)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("skip on patches", func(t *testing.T) {
|
t.Run("skip/disable", func(t *testing.T) {
|
||||||
ctx := testctx.NewWithCfg(config.Project{
|
ctx := testctx.NewWithCfg(config.Project{
|
||||||
Changelog: config.Changelog{
|
Changelog: config.Changelog{
|
||||||
Skip: "{{gt .Patch 0}}",
|
Skip: "{{gt .Patch 0}}",
|
||||||
@@ -691,12 +691,24 @@ func TestSkip(t *testing.T) {
|
|||||||
b, err := Pipe{}.Skip(ctx)
|
b, err := Pipe{}.Skip(ctx)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.True(t, b)
|
require.True(t, b)
|
||||||
|
require.Equal(t, ctx.Config.Changelog.Skip, ctx.Config.Changelog.Disable)
|
||||||
|
})
|
||||||
|
|
||||||
|
t.Run("disable on patches", func(t *testing.T) {
|
||||||
|
ctx := testctx.NewWithCfg(config.Project{
|
||||||
|
Changelog: config.Changelog{
|
||||||
|
Disable: "{{gt .Patch 0}}",
|
||||||
|
},
|
||||||
|
}, testctx.WithSemver(0, 0, 1, ""))
|
||||||
|
b, err := Pipe{}.Skip(ctx)
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.True(t, b)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("invalid template", func(t *testing.T) {
|
t.Run("invalid template", func(t *testing.T) {
|
||||||
ctx := testctx.NewWithCfg(config.Project{
|
ctx := testctx.NewWithCfg(config.Project{
|
||||||
Changelog: config.Changelog{
|
Changelog: config.Changelog{
|
||||||
Skip: "{{if eq .Patch 123}",
|
Disable: "{{if eq .Patch 123}",
|
||||||
},
|
},
|
||||||
}, testctx.WithSemver(0, 0, 1, ""))
|
}, testctx.WithSemver(0, 0, 1, ""))
|
||||||
_, err := Pipe{}.Skip(ctx)
|
_, err := Pipe{}.Skip(ctx)
|
||||||
@@ -712,7 +724,7 @@ func TestSkip(t *testing.T) {
|
|||||||
t.Run("dont skip based on template", func(t *testing.T) {
|
t.Run("dont skip based on template", func(t *testing.T) {
|
||||||
ctx := testctx.NewWithCfg(config.Project{
|
ctx := testctx.NewWithCfg(config.Project{
|
||||||
Changelog: config.Changelog{
|
Changelog: config.Changelog{
|
||||||
Skip: "{{gt .Patch 0}}",
|
Disable: "{{gt .Patch 0}}",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
b, err := Pipe{}.Skip(ctx)
|
b, err := Pipe{}.Skip(ctx)
|
||||||
|
|||||||
@@ -1065,10 +1065,13 @@ type Filters struct {
|
|||||||
type Changelog struct {
|
type Changelog struct {
|
||||||
Filters Filters `yaml:"filters,omitempty" json:"filters,omitempty"`
|
Filters Filters `yaml:"filters,omitempty" json:"filters,omitempty"`
|
||||||
Sort string `yaml:"sort,omitempty" json:"sort,omitempty" jsonschema:"enum=asc,enum=desc,enum=,default="`
|
Sort string `yaml:"sort,omitempty" json:"sort,omitempty" jsonschema:"enum=asc,enum=desc,enum=,default="`
|
||||||
Skip string `yaml:"skip,omitempty" json:"skip,omitempty" jsonschema:"oneof_type=string;boolean"` // TODO(caarlos0): rename to Disable to match other pipes
|
Disable string `yaml:"disable,omitempty" json:"disable,omitempty" jsonschema:"oneof_type=string;boolean"`
|
||||||
Use string `yaml:"use,omitempty" json:"use,omitempty" jsonschema:"enum=git,enum=github,enum=github-native,enum=gitlab,default=git"`
|
Use string `yaml:"use,omitempty" json:"use,omitempty" jsonschema:"enum=git,enum=github,enum=github-native,enum=gitlab,default=git"`
|
||||||
Groups []ChangelogGroup `yaml:"groups,omitempty" json:"groups,omitempty"`
|
Groups []ChangelogGroup `yaml:"groups,omitempty" json:"groups,omitempty"`
|
||||||
Abbrev int `yaml:"abbrev,omitempty" json:"abbrev,omitempty"`
|
Abbrev int `yaml:"abbrev,omitempty" json:"abbrev,omitempty"`
|
||||||
|
|
||||||
|
// Deprecated: use disable instead.
|
||||||
|
Skip string `yaml:"skip,omitempty" json:"skip,omitempty" jsonschema:"oneof_type=string;boolean,deprecated=true,description=use disable_disable instead"` // TODO(caarlos0): rename to Disable to match other pipes
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChangelogGroup holds the grouping criteria for the changelog.
|
// ChangelogGroup holds the grouping criteria for the changelog.
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ changelog:
|
|||||||
# This may result in an empty release notes on GitHub/GitLab/Gitea.
|
# This may result in an empty release notes on GitHub/GitLab/Gitea.
|
||||||
#
|
#
|
||||||
# Templates: allowed
|
# Templates: allowed
|
||||||
skip: "{{ .Env.CREATE_CHANGELOG }}"
|
disable: "{{ .Env.CREATE_CHANGELOG }}"
|
||||||
|
|
||||||
# Changelog generation implementation to use.
|
# Changelog generation implementation to use.
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -27,18 +27,38 @@ Description.
|
|||||||
|
|
||||||
=== "Before"
|
=== "Before"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
foo: bar
|
foo: bar
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "After"
|
=== "After"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
foo: bar
|
foo: bar
|
||||||
```
|
```
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
### changelog.skip
|
||||||
|
|
||||||
|
> since 2024-01-14
|
||||||
|
|
||||||
|
Changed to `disable` to conform with all other pipes.
|
||||||
|
|
||||||
|
=== "Before"
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
changelog:
|
||||||
|
skip: true
|
||||||
|
```
|
||||||
|
|
||||||
|
=== "After"
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
changelog:
|
||||||
|
disable: true
|
||||||
|
```
|
||||||
|
|
||||||
### blobs.kmskey
|
### blobs.kmskey
|
||||||
|
|
||||||
> since 2024-01-07
|
> since 2024-01-07
|
||||||
@@ -47,14 +67,14 @@ Changed to `kms_key` to conform with all other options.
|
|||||||
|
|
||||||
=== "Before"
|
=== "Before"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
blobs:
|
blobs:
|
||||||
- kmskey: foo
|
- kmskey: foo
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "After"
|
=== "After"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
blobs:
|
blobs:
|
||||||
- kms_key: foo
|
- kms_key: foo
|
||||||
```
|
```
|
||||||
@@ -67,14 +87,14 @@ Changed to `disable_ssl` to conform with all other options.
|
|||||||
|
|
||||||
=== "Before"
|
=== "Before"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
blobs:
|
blobs:
|
||||||
- disableSSL: true
|
- disableSSL: true
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "After"
|
=== "After"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
blobs:
|
blobs:
|
||||||
- disable_ssl: true
|
- disable_ssl: true
|
||||||
```
|
```
|
||||||
@@ -279,14 +299,14 @@ GoReleaser now allows many `scoop` configurations, so it should be pluralized
|
|||||||
|
|
||||||
=== "Before"
|
=== "Before"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
scoop:
|
scoop:
|
||||||
# ...
|
# ...
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "After"
|
=== "After"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
scoops:
|
scoops:
|
||||||
- # ...
|
- # ...
|
||||||
```
|
```
|
||||||
@@ -303,14 +323,14 @@ Simply use the pluralized form, `builds`, according to the
|
|||||||
|
|
||||||
=== "Before"
|
=== "Before"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
build:
|
build:
|
||||||
# ...
|
# ...
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "After"
|
=== "After"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
builds:
|
builds:
|
||||||
- # ...
|
- # ...
|
||||||
```
|
```
|
||||||
@@ -380,7 +400,7 @@ enable this option and test it out with
|
|||||||
|
|
||||||
=== "After"
|
=== "After"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
archives:
|
archives:
|
||||||
-
|
-
|
||||||
rlcp: true
|
rlcp: true
|
||||||
@@ -394,7 +414,7 @@ Same as [`archives.rlcp`](#archivesrlcp).
|
|||||||
|
|
||||||
=== "After"
|
=== "After"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
source:
|
source:
|
||||||
rlcp: true
|
rlcp: true
|
||||||
```
|
```
|
||||||
@@ -431,7 +451,7 @@ You can still get the same features by abusing the `name_template` property.
|
|||||||
|
|
||||||
=== "Before"
|
=== "Before"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
archives:
|
archives:
|
||||||
- id: foo
|
- id: foo
|
||||||
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
|
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
|
||||||
@@ -445,7 +465,7 @@ You can still get the same features by abusing the `name_template` property.
|
|||||||
|
|
||||||
=== "After"
|
=== "After"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
archives:
|
archives:
|
||||||
- id: foo
|
- id: foo
|
||||||
name_template: >-
|
name_template: >-
|
||||||
@@ -472,7 +492,7 @@ You can still get the same features by abusing the `file_name_template` property
|
|||||||
|
|
||||||
=== "Before"
|
=== "Before"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
nfpms:
|
nfpms:
|
||||||
- id: foo
|
- id: foo
|
||||||
file_name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
|
file_name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
|
||||||
@@ -486,7 +506,7 @@ You can still get the same features by abusing the `file_name_template` property
|
|||||||
|
|
||||||
=== "After"
|
=== "After"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
nfpms:
|
nfpms:
|
||||||
- id: foo
|
- id: foo
|
||||||
file_name_template: >-
|
file_name_template: >-
|
||||||
@@ -513,7 +533,7 @@ You can still get the same features by abusing the `name_template` property.
|
|||||||
|
|
||||||
=== "Before"
|
=== "Before"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
snapcrafts:
|
snapcrafts:
|
||||||
- id: foo
|
- id: foo
|
||||||
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
|
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
|
||||||
@@ -527,7 +547,7 @@ You can still get the same features by abusing the `name_template` property.
|
|||||||
|
|
||||||
=== "After"
|
=== "After"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
snapcrafts:
|
snapcrafts:
|
||||||
- id: foo
|
- id: foo
|
||||||
name_template: >-
|
name_template: >-
|
||||||
@@ -551,7 +571,7 @@ On [GoReleaser PRO](/pro/) custom variables should now be prefixed with `.Var`.
|
|||||||
|
|
||||||
=== "Before"
|
=== "Before"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
variables:
|
variables:
|
||||||
foo: bar
|
foo: bar
|
||||||
some_template: 'lala-{{ .foo }}'
|
some_template: 'lala-{{ .foo }}'
|
||||||
@@ -559,7 +579,7 @@ On [GoReleaser PRO](/pro/) custom variables should now be prefixed with `.Var`.
|
|||||||
|
|
||||||
=== "After"
|
=== "After"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
variables:
|
variables:
|
||||||
foo: bar
|
foo: bar
|
||||||
some_template: 'lala-{{ .Var.foo }}'
|
some_template: 'lala-{{ .Var.foo }}'
|
||||||
@@ -589,7 +609,7 @@ nFPM empty folders is now deprecated in favor of a `dir` content type:
|
|||||||
|
|
||||||
=== "Before"
|
=== "Before"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
nfpms:
|
nfpms:
|
||||||
- empty_folders:
|
- empty_folders:
|
||||||
- /foo/bar
|
- /foo/bar
|
||||||
@@ -597,7 +617,7 @@ nFPM empty folders is now deprecated in favor of a `dir` content type:
|
|||||||
|
|
||||||
=== "After"
|
=== "After"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
nfpms:
|
nfpms:
|
||||||
- contents:
|
- contents:
|
||||||
- dst: /foo/bar
|
- dst: /foo/bar
|
||||||
@@ -978,14 +998,14 @@ so the name `puts` kind of lost its meaning.
|
|||||||
|
|
||||||
=== "Before"
|
=== "Before"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
puts:
|
puts:
|
||||||
- ...
|
- ...
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "After"
|
=== "After"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
uploads:
|
uploads:
|
||||||
- ...
|
- ...
|
||||||
```
|
```
|
||||||
@@ -1002,14 +1022,14 @@ The `name_template` field was deprecated in favor of a more clear one,
|
|||||||
|
|
||||||
=== "Before"
|
=== "Before"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
nfpms:
|
nfpms:
|
||||||
- name_template: foo
|
- name_template: foo
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "After"
|
=== "After"
|
||||||
|
|
||||||
``` yaml
|
```yaml
|
||||||
nfpms:
|
nfpms:
|
||||||
- file_name_template: foo
|
- file_name_template: foo
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user