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/goreleaser/goreleaser/internal/client"
|
||||
"github.com/goreleaser/goreleaser/internal/deprecate"
|
||||
"github.com/goreleaser/goreleaser/internal/git"
|
||||
"github.com/goreleaser/goreleaser/internal/tmpl"
|
||||
"github.com/goreleaser/goreleaser/pkg/context"
|
||||
@@ -43,7 +44,12 @@ func (Pipe) Skip(ctx *context.Context) (bool, error) {
|
||||
if ctx.Snapshot {
|
||||
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.
|
||||
|
||||
@@ -682,7 +682,7 @@ func TestSkip(t *testing.T) {
|
||||
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{
|
||||
Changelog: config.Changelog{
|
||||
Skip: "{{gt .Patch 0}}",
|
||||
@@ -691,12 +691,24 @@ func TestSkip(t *testing.T) {
|
||||
b, err := Pipe{}.Skip(ctx)
|
||||
require.NoError(t, err)
|
||||
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) {
|
||||
ctx := testctx.NewWithCfg(config.Project{
|
||||
Changelog: config.Changelog{
|
||||
Skip: "{{if eq .Patch 123}",
|
||||
Disable: "{{if eq .Patch 123}",
|
||||
},
|
||||
}, testctx.WithSemver(0, 0, 1, ""))
|
||||
_, err := Pipe{}.Skip(ctx)
|
||||
@@ -712,7 +724,7 @@ func TestSkip(t *testing.T) {
|
||||
t.Run("dont skip based on template", func(t *testing.T) {
|
||||
ctx := testctx.NewWithCfg(config.Project{
|
||||
Changelog: config.Changelog{
|
||||
Skip: "{{gt .Patch 0}}",
|
||||
Disable: "{{gt .Patch 0}}",
|
||||
},
|
||||
})
|
||||
b, err := Pipe{}.Skip(ctx)
|
||||
|
||||
@@ -1065,10 +1065,13 @@ type Filters struct {
|
||||
type Changelog struct {
|
||||
Filters Filters `yaml:"filters,omitempty" json:"filters,omitempty"`
|
||||
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"`
|
||||
Groups []ChangelogGroup `yaml:"groups,omitempty" json:"groups,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.
|
||||
|
||||
@@ -13,7 +13,7 @@ changelog:
|
||||
# This may result in an empty release notes on GitHub/GitLab/Gitea.
|
||||
#
|
||||
# Templates: allowed
|
||||
skip: "{{ .Env.CREATE_CHANGELOG }}"
|
||||
disable: "{{ .Env.CREATE_CHANGELOG }}"
|
||||
|
||||
# Changelog generation implementation to use.
|
||||
#
|
||||
|
||||
@@ -27,18 +27,38 @@ Description.
|
||||
|
||||
=== "Before"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
foo: bar
|
||||
```
|
||||
|
||||
=== "After"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
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
|
||||
|
||||
> since 2024-01-07
|
||||
@@ -47,14 +67,14 @@ Changed to `kms_key` to conform with all other options.
|
||||
|
||||
=== "Before"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
blobs:
|
||||
- kmskey: foo
|
||||
```
|
||||
|
||||
=== "After"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
blobs:
|
||||
- kms_key: foo
|
||||
```
|
||||
@@ -67,14 +87,14 @@ Changed to `disable_ssl` to conform with all other options.
|
||||
|
||||
=== "Before"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
blobs:
|
||||
- disableSSL: true
|
||||
```
|
||||
|
||||
=== "After"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
blobs:
|
||||
- disable_ssl: true
|
||||
```
|
||||
@@ -279,14 +299,14 @@ GoReleaser now allows many `scoop` configurations, so it should be pluralized
|
||||
|
||||
=== "Before"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
scoop:
|
||||
# ...
|
||||
```
|
||||
|
||||
=== "After"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
scoops:
|
||||
- # ...
|
||||
```
|
||||
@@ -303,14 +323,14 @@ Simply use the pluralized form, `builds`, according to the
|
||||
|
||||
=== "Before"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
build:
|
||||
# ...
|
||||
```
|
||||
|
||||
=== "After"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
builds:
|
||||
- # ...
|
||||
```
|
||||
@@ -380,7 +400,7 @@ enable this option and test it out with
|
||||
|
||||
=== "After"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
archives:
|
||||
-
|
||||
rlcp: true
|
||||
@@ -394,7 +414,7 @@ Same as [`archives.rlcp`](#archivesrlcp).
|
||||
|
||||
=== "After"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
source:
|
||||
rlcp: true
|
||||
```
|
||||
@@ -431,7 +451,7 @@ You can still get the same features by abusing the `name_template` property.
|
||||
|
||||
=== "Before"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
archives:
|
||||
- id: foo
|
||||
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"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
archives:
|
||||
- id: foo
|
||||
name_template: >-
|
||||
@@ -472,7 +492,7 @@ You can still get the same features by abusing the `file_name_template` property
|
||||
|
||||
=== "Before"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
nfpms:
|
||||
- id: foo
|
||||
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"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
nfpms:
|
||||
- id: foo
|
||||
file_name_template: >-
|
||||
@@ -513,7 +533,7 @@ You can still get the same features by abusing the `name_template` property.
|
||||
|
||||
=== "Before"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
snapcrafts:
|
||||
- id: foo
|
||||
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"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
snapcrafts:
|
||||
- id: foo
|
||||
name_template: >-
|
||||
@@ -551,7 +571,7 @@ On [GoReleaser PRO](/pro/) custom variables should now be prefixed with `.Var`.
|
||||
|
||||
=== "Before"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
variables:
|
||||
foo: bar
|
||||
some_template: 'lala-{{ .foo }}'
|
||||
@@ -559,7 +579,7 @@ On [GoReleaser PRO](/pro/) custom variables should now be prefixed with `.Var`.
|
||||
|
||||
=== "After"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
variables:
|
||||
foo: bar
|
||||
some_template: 'lala-{{ .Var.foo }}'
|
||||
@@ -589,7 +609,7 @@ nFPM empty folders is now deprecated in favor of a `dir` content type:
|
||||
|
||||
=== "Before"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
nfpms:
|
||||
- empty_folders:
|
||||
- /foo/bar
|
||||
@@ -597,7 +617,7 @@ nFPM empty folders is now deprecated in favor of a `dir` content type:
|
||||
|
||||
=== "After"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
nfpms:
|
||||
- contents:
|
||||
- dst: /foo/bar
|
||||
@@ -978,14 +998,14 @@ so the name `puts` kind of lost its meaning.
|
||||
|
||||
=== "Before"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
puts:
|
||||
- ...
|
||||
```
|
||||
|
||||
=== "After"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
uploads:
|
||||
- ...
|
||||
```
|
||||
@@ -1002,14 +1022,14 @@ The `name_template` field was deprecated in favor of a more clear one,
|
||||
|
||||
=== "Before"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
nfpms:
|
||||
- name_template: foo
|
||||
```
|
||||
|
||||
=== "After"
|
||||
|
||||
``` yaml
|
||||
```yaml
|
||||
nfpms:
|
||||
- file_name_template: foo
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user