You've already forked goreleaser
							
							
				mirror of
				https://github.com/goreleaser/goreleaser.git
				synced 2025-10-30 23:58:09 +02:00 
			
		
		
		
	fix: deprecate brews.plist (#4073)
service has been available for a long time as well. closes #3990
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							4936929ddd
						
					
				
				
					commit
					de599666b8
				
			| @@ -16,6 +16,7 @@ import ( | ||||
| 	"github.com/goreleaser/goreleaser/internal/artifact" | ||||
| 	"github.com/goreleaser/goreleaser/internal/client" | ||||
| 	"github.com/goreleaser/goreleaser/internal/commitauthor" | ||||
| 	"github.com/goreleaser/goreleaser/internal/deprecate" | ||||
| 	"github.com/goreleaser/goreleaser/internal/pipe" | ||||
| 	"github.com/goreleaser/goreleaser/internal/tmpl" | ||||
| 	"github.com/goreleaser/goreleaser/pkg/config" | ||||
| @@ -63,6 +64,9 @@ func (Pipe) Default(ctx *context.Context) error { | ||||
| 		if brew.Goamd64 == "" { | ||||
| 			brew.Goamd64 = "v1" | ||||
| 		} | ||||
| 		if brew.Plist != "" { | ||||
| 			deprecate.Notice(ctx, "brews.plist") | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
|   | ||||
| @@ -1161,7 +1161,9 @@ func TestDefault(t *testing.T) { | ||||
| 	ctx := testctx.NewWithCfg(config.Project{ | ||||
| 		ProjectName: "myproject", | ||||
| 		Brews: []config.Homebrew{ | ||||
| 			{}, | ||||
| 			{ | ||||
| 				Plist: "<xml>... whatever</xml>", | ||||
| 			}, | ||||
| 		}, | ||||
| 	}, testctx.GitHubTokenType) | ||||
| 	require.NoError(t, Pipe{}.Default(ctx)) | ||||
| @@ -1169,6 +1171,7 @@ func TestDefault(t *testing.T) { | ||||
| 	require.NotEmpty(t, ctx.Config.Brews[0].CommitAuthor.Name) | ||||
| 	require.NotEmpty(t, ctx.Config.Brews[0].CommitAuthor.Email) | ||||
| 	require.NotEmpty(t, ctx.Config.Brews[0].CommitMessageTemplate) | ||||
| 	require.True(t, ctx.Deprecated) | ||||
| } | ||||
|  | ||||
| func TestGHFolder(t *testing.T) { | ||||
|   | ||||
| @@ -222,7 +222,7 @@ type Homebrew struct { | ||||
| 	CommitMessageTemplate string               `yaml:"commit_msg_template,omitempty" json:"commit_msg_template,omitempty"` | ||||
| 	Folder                string               `yaml:"folder,omitempty" json:"folder,omitempty"` | ||||
| 	Caveats               string               `yaml:"caveats,omitempty" json:"caveats,omitempty"` | ||||
| 	Plist                 string               `yaml:"plist,omitempty" json:"plist,omitempty"` | ||||
| 	Plist                 string               `yaml:"plist,omitempty" json:"plist,omitempty"` // Deprecated | ||||
| 	Install               string               `yaml:"install,omitempty" json:"install,omitempty"` | ||||
| 	PostInstall           string               `yaml:"post_install,omitempty" json:"post_install,omitempty"` | ||||
| 	Dependencies          []HomebrewDependency `yaml:"dependencies,omitempty" json:"dependencies,omitempty"` | ||||
|   | ||||
| @@ -30,12 +30,43 @@ Description. | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ``` yaml | ||||
|     foo: bar | ||||
|     ``` | ||||
|  | ||||
| --> | ||||
|  | ||||
| ### brews.plist | ||||
|  | ||||
| > since 2023-06-06 (v1.19.0) | ||||
|  | ||||
| `plist` is deprecated by Homebrew, and now on GoReleaser too. Use `service` | ||||
| instead. | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     brews: | ||||
|     - | ||||
|       plist: | | ||||
|         <?xml version="1.0" encoding="UTF-8"?> | ||||
|         <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||||
|         <plist version="1.0"> | ||||
|         <dict> | ||||
|         # etc ... | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     brews: | ||||
|     - | ||||
|       service: | | ||||
|         run [opt_bin/"mybin"] | ||||
|         keep_alive true | ||||
|         # etc ... | ||||
|     ``` | ||||
|  | ||||
| ### --debug | ||||
|  | ||||
| @@ -70,11 +101,10 @@ GoReleaser now allows many `scoop` configurations, so it should be pluralized | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|     ``` yaml | ||||
| `yaml | ||||
|     scoops: | ||||
|     - # ... | ||||
|     ``` | ||||
|  | ||||
|    ` | ||||
|  | ||||
| ### build | ||||
|  | ||||
| @@ -94,12 +124,12 @@ Simply use the pluralized form, `builds`, according to the | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ``` yaml | ||||
|     builds: | ||||
|     - # ... | ||||
|     ``` | ||||
|  | ||||
|  | ||||
| ### --rm-dist | ||||
|  | ||||
| > since 2023-01-17 (v1.15.0) | ||||
| @@ -140,6 +170,7 @@ enable this option and test it out with | ||||
| `goreleaser release --snapshot --clean`. | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ``` yaml | ||||
|     archives: | ||||
|     - | ||||
| @@ -153,6 +184,7 @@ enable this option and test it out with | ||||
| Same as [`archives.rlcp`](#archivesrlcp). | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ``` yaml | ||||
|     source: | ||||
|       rlcp: true | ||||
| @@ -183,6 +215,7 @@ You can still get the same features by abusing the `name_template` property. | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ``` yaml | ||||
|     archives: | ||||
|       - id: foo | ||||
| @@ -199,7 +232,6 @@ Those two configurations will yield the same results. | ||||
| Notice that if you are using the `archives.name_template`, notice it also has a | ||||
| `{{.Version}}` in it. Adjust the new `name_template` accordingly. | ||||
|  | ||||
|  | ||||
| ### nfpms.replacements | ||||
|  | ||||
| > since 2022-11-24 (v1.14.0) | ||||
| @@ -223,6 +255,7 @@ You can still get the same features by abusing the `file_name_template` property | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ``` yaml | ||||
|     nfpms: | ||||
|       - id: foo | ||||
| @@ -262,6 +295,7 @@ You can still get the same features by abusing the `name_template` property. | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ``` yaml | ||||
|     snapcrafts: | ||||
|       - id: foo | ||||
| @@ -278,8 +312,6 @@ Those two configurations will yield the same results. | ||||
| Generally speaking, is probably best to use `{{ .ConventionalFileName }}` | ||||
| instead of custom templates. | ||||
|  | ||||
|  | ||||
|  | ||||
| ### nfpms.maintainer | ||||
|  | ||||
| > since 2022-05-07 (v1.9.0) | ||||
| @@ -287,23 +319,23 @@ instead of custom templates. | ||||
| nFPM will soon make mandatory setting the maintainer field. | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpms: | ||||
|     - maintainer: '' | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpms: | ||||
|     - maintainer: 'Name <email>' | ||||
|     ``` | ||||
|  | ||||
|  | ||||
| ## Expired deprecation notices | ||||
|  | ||||
| The following options were deprecated in the past and were already removed. | ||||
|  | ||||
|  | ||||
| ### variables | ||||
|  | ||||
| > since 2022-01-20 (v1.4.0), removed 2023-05-01 (v1.18.0) | ||||
| @@ -357,6 +389,7 @@ nFPM empty folders is now deprecated in favor of a `dir` content type: | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ``` yaml | ||||
|     nfpms: | ||||
|     - contents: | ||||
| @@ -364,7 +397,6 @@ nFPM empty folders is now deprecated in favor of a `dir` content type: | ||||
|         type: dir | ||||
|     ``` | ||||
|  | ||||
|  | ||||
| ### builds for windows/arm64 | ||||
|  | ||||
| > since 2021-08-16 (v0.175.0), removed 2022-06-12 (v1.10.0) | ||||
| @@ -378,8 +410,8 @@ If you want to make sure it is ignored in the future, you need to add this to yo | ||||
|  | ||||
| ```yaml | ||||
| ignore: | ||||
| - goos: windows | ||||
|   goarch: arm64 | ||||
|   - goos: windows | ||||
|     goarch: arm64 | ||||
| ``` | ||||
|  | ||||
| If you try to use new versions of GoReleaser with Go 1.16 or older, it will warn | ||||
| @@ -412,6 +444,7 @@ Please follow to the check their documentation for alternative install methods. | ||||
| Change this: | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|       - | ||||
| @@ -419,6 +452,7 @@ Change this: | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|       - | ||||
| @@ -438,8 +472,8 @@ If you want to make sure it is ignored in the future, you need to add this to yo | ||||
|  | ||||
| ```yaml | ||||
| ignore: | ||||
| - goos: darwin | ||||
|   goarch: arm64 | ||||
|   - goos: darwin | ||||
|     goarch: arm64 | ||||
| ``` | ||||
|  | ||||
| If you try to use new versions of GoReleaser with Go 1.15 or older, it will warn about it until this deprecation warning expires, after that your build will likely fail. | ||||
| @@ -461,6 +495,7 @@ Because of that, once this deprecation expires, GoReleaser will hard fail on non | ||||
| Change this: | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|       - | ||||
| @@ -468,6 +503,7 @@ Change this: | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|       - | ||||
| @@ -484,6 +520,7 @@ If you want to filter something out, use the `ids` property. | ||||
| Change this: | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|       - | ||||
| @@ -491,6 +528,7 @@ Change this: | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|       - | ||||
| @@ -506,6 +544,7 @@ Change this: | ||||
| Change this: | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpms: | ||||
|       - | ||||
| @@ -514,6 +553,7 @@ Change this: | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpms: | ||||
|       - | ||||
| @@ -531,6 +571,7 @@ Change this: | ||||
| Change this: | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpms: | ||||
|       - | ||||
| @@ -539,6 +580,7 @@ Change this: | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpms: | ||||
|       - | ||||
| @@ -557,6 +599,7 @@ Change this: | ||||
| Change this: | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpms: | ||||
|       - | ||||
| @@ -565,6 +608,7 @@ Change this: | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpms: | ||||
|       - | ||||
| @@ -583,6 +627,7 @@ Change this: | ||||
| Change this: | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpms: | ||||
|       - | ||||
| @@ -592,6 +637,7 @@ Change this: | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpms: | ||||
|       - | ||||
| @@ -610,6 +656,7 @@ Change this: | ||||
| Change this: | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpms: | ||||
|       - | ||||
| @@ -619,6 +666,7 @@ Change this: | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpms: | ||||
|       - | ||||
| @@ -629,7 +677,6 @@ Change this: | ||||
|             packager: rpm # optional | ||||
|     ``` | ||||
|  | ||||
|  | ||||
| ### nfpms.deb.version_metadata | ||||
|  | ||||
| > since 2020-12-21 (v0.149.0), removed 2021-07-26 (v0.172.0) | ||||
| @@ -639,6 +686,7 @@ Change this: | ||||
| Change this: | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpms: | ||||
|       - | ||||
| @@ -647,6 +695,7 @@ Change this: | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpms: | ||||
|       - | ||||
| @@ -664,6 +713,7 @@ automatically when GitHub token is passed. | ||||
| Change this: | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     brews: | ||||
|       - | ||||
| @@ -673,6 +723,7 @@ Change this: | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     brews: | ||||
|       - | ||||
| @@ -692,6 +743,7 @@ automatically when GitLab token is passed. | ||||
| Change this: | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     brews: | ||||
|       - | ||||
| @@ -701,6 +753,7 @@ Change this: | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     brews: | ||||
|       - | ||||
| @@ -724,6 +777,7 @@ so the name `puts` kind of lost its meaning. | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ``` yaml | ||||
|     uploads: | ||||
|     - ... | ||||
| @@ -740,13 +794,14 @@ The `name_template` field was deprecated in favor of a more clear one, | ||||
| `file_name_template`. | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ``` yaml | ||||
|     nfpms: | ||||
|     - name_template: foo | ||||
|     ``` | ||||
|  | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ``` yaml | ||||
|     nfpms: | ||||
|     - file_name_template: foo | ||||
| @@ -761,12 +816,14 @@ It was already accepting multiple inputs, but its pluralized now so its more | ||||
| clear. | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     blob: | ||||
|       # etc | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     blobs: | ||||
|       # etc | ||||
| @@ -779,12 +836,14 @@ clear. | ||||
| Sign was deprecated in favor of its plural form. | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     sign: | ||||
|       # etc | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     signs: | ||||
|       - | ||||
| @@ -800,12 +859,14 @@ Brew was deprecated in favor of its plural form. | ||||
| Change this: | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     brew: | ||||
|       # etc | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     brews: | ||||
|       - | ||||
| @@ -820,6 +881,7 @@ S3 was deprecated in favor of the new `blob`, which supports S3, Azure Blob and | ||||
| GCS. | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     s3: | ||||
|     - | ||||
| @@ -827,6 +889,7 @@ GCS. | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     blobs: | ||||
|     - | ||||
| @@ -843,12 +906,14 @@ ACLs should be set on the bucket, the `acl` option does not exist anymore. | ||||
| We now allow multiple archives, so the `archive` statement will be removed. | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     archive: | ||||
|       format: zip | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     archives: | ||||
|       - id: foo | ||||
| @@ -862,6 +927,7 @@ We now allow multiple archives, so the `archive` statement will be removed. | ||||
| We now allow multiple Snapcraft configs, so the `snapcraft` statement will be removed. | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     snapcraft: | ||||
|       publish: true | ||||
| @@ -869,6 +935,7 @@ We now allow multiple Snapcraft configs, so the `snapcraft` statement will be re | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     snapcrafts: | ||||
|       - | ||||
| @@ -883,6 +950,7 @@ We now allow multiple Snapcraft configs, so the `snapcraft` statement will be re | ||||
| We now allow multiple NFPM config, so the `nfpm` statement will be removed. | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpm: | ||||
|       formats: | ||||
| @@ -890,6 +958,7 @@ We now allow multiple NFPM config, so the `nfpm` statement will be removed. | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpms: | ||||
|       - | ||||
| @@ -904,6 +973,7 @@ We now allow multiple NFPM config, so the `nfpm` statement will be removed. | ||||
| You can now create a Docker image with multiple binaries. | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|     - image: foo/bar | ||||
| @@ -911,6 +981,7 @@ You can now create a Docker image with multiple binaries. | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|     - image: foo/bar | ||||
| @@ -927,6 +998,7 @@ The idea is to be able to define several images and tags using templates instead | ||||
| This flexibility allows images to be pushed to multiple registries. | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|     - image: foo/bar | ||||
| @@ -935,6 +1007,7 @@ This flexibility allows images to be pushed to multiple registries. | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|     - image_templates: | ||||
| @@ -949,6 +1022,7 @@ This property was deprecated in favor of more flexible `image_templates`. | ||||
| The idea is to be able to define several images and tags using templates instead of just one image with tag templates. | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|     - image: foo/bar | ||||
| @@ -957,6 +1031,7 @@ The idea is to be able to define several images and tags using templates instead | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|     - image_templates: | ||||
| @@ -972,6 +1047,7 @@ instead of the full ones. This has been removed in favor of specific | ||||
| template variables (`.FullCommit` and `.ShortCommit`). | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     git: | ||||
|       short_hash: true | ||||
| @@ -981,6 +1057,7 @@ template variables (`.FullCommit` and `.ShortCommit`). | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     fake: | ||||
|       foo_template: 'blah {{ .ShortCommit }}' | ||||
| @@ -997,12 +1074,14 @@ CI/CD pipelines. | ||||
| Just replace the `fpm` keyword by `nfpm` in your `.goreleaser.yaml` file. | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     fpm: | ||||
|       # ... | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     nfpm: | ||||
|       # ... | ||||
| @@ -1016,6 +1095,7 @@ This property was deprecated in favor of the pluralized `tag_templates`. | ||||
| The idea is to be able to define several tags instead of just one. | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|     - image: foo/bar | ||||
| @@ -1023,6 +1103,7 @@ The idea is to be able to define several tags instead of just one. | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|     - image: foo/bar | ||||
| @@ -1038,6 +1119,7 @@ The `latest` field in Docker config is deprecated in favor of the newer | ||||
| `tag_templates` field. | ||||
|  | ||||
| === "Before" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|     - image: foo/bar | ||||
| @@ -1045,6 +1127,7 @@ The `latest` field in Docker config is deprecated in favor of the newer | ||||
|     ``` | ||||
|  | ||||
| === "After" | ||||
|  | ||||
|     ```yaml | ||||
|     dockers: | ||||
|     - image: foo/bar | ||||
|   | ||||
		Reference in New Issue
	
	Block a user