1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-11 14:39:28 +02:00

feat: deprecate gofish (#2999)

* feat: deprecate gofish

gofish was deprecated by its authors, this deprecates it here too

refs https://github.com/goreleaser/goreleaser/discussions/2998

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* fix: do not publish rig anymore

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* docs: remove install

* chore: deprecate

* fix(gofish): fix broke logs

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker 2022-04-02 10:41:05 -03:00 committed by GitHub
parent c4a2148e3b
commit 3df29b67ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 20 additions and 149 deletions

View File

@ -163,14 +163,6 @@ brews:
fish_completion.install "completions/goreleaser.fish"
man1.install "manpages/goreleaser.1.gz"
rigs:
- rig:
owner: goreleaser
name: fish-food
homepage: https://goreleaser.com
description: Deliver Go binaries as fast and easily as possible
license: MIT
aurs:
- homepage: https://goreleaser.com
description: Deliver Go binaries as fast and easily as possible

View File

@ -44,7 +44,12 @@ func Notice(ctx *context.Context, property string) {
func NoticeCustom(ctx *context.Context, property, tmpl string) {
ctx.Deprecated = true
// XXX: this is very ugly!
w := log.Log.(*log.Logger).Handler.(*cli.Handler).Writer
oldHandler, ok := log.Log.(*log.Logger).Handler.(*cli.Handler)
if !ok {
// probably in a test, and the cli logger wasn't set
return
}
w := oldHandler.Writer
handler := cli.New(w)
handler.Padding = cli.Default.Padding + 3
log := &log.Logger{

View File

@ -15,6 +15,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"
@ -35,6 +36,9 @@ func (Pipe) String() string { return "gofish fish food cookbook"
func (Pipe) Skip(ctx *context.Context) bool { return len(ctx.Config.Rigs) == 0 }
func (Pipe) Default(ctx *context.Context) error {
if len(ctx.Config.Rigs) > 0 {
deprecate.Notice(ctx, "rigs")
}
for i := range ctx.Config.Rigs {
goFish := &ctx.Config.Rigs[i]

View File

@ -144,7 +144,7 @@ type GoFish struct {
URLTemplate string `yaml:"url_template,omitempty"`
IDs []string `yaml:"ids,omitempty"`
Goarm string `yaml:"goarm,omitempty"`
}
} // deprecated
// Homebrew contains the brew section.
type Homebrew struct {
@ -893,7 +893,7 @@ type Project struct {
Release Release `yaml:"release,omitempty"`
Milestones []Milestone `yaml:"milestones,omitempty"`
Brews []Homebrew `yaml:"brews,omitempty"`
Rigs []GoFish `yaml:"rigs,omitempty"`
Rigs []GoFish `yaml:"rigs,omitempty"` // deprecated
AURs []AUR `yaml:"aurs,omitempty"`
Krews []Krew `yaml:"krews,omitempty"`
Scoop Scoop `yaml:"scoop,omitempty"`

View File

@ -1,122 +0,0 @@
# GoFish
After releasing to GitHub or GitLab, GoReleaser can generate and publish
a _Fish Food_ Cookbook into a repository that you have access to.
The `rigs` section specifies how the fish food should be created.
You can check the
[GoFish documentation](https://gofi.sh/#intro)
and the
[Fish food cookbook](https://gofi.sh/#cookbook)
for more details.
```yaml
# .goreleaser.yaml
rigs:
-
# Name template of the recipe
# Default to project name
name: myproject
# IDs of the archives to use.
# Defaults to all.
ids:
- foo
- bar
# GOARM to specify which 32-bit arm version to use if there are multiple versions
# from the build section. GoFish fish food support atm only one 32-bit version.
# Default is 6 for all artifacts or each id if there a multiple versions.
goarm: 6
# NOTE: make sure the url_template, the token and given repo (github or gitlab) owner and name are from the
# same kind. We will probably unify this in the next major version like it is done with scoop.
# GitHub/GitLab repository to push the fish food to
# Gitea is not supported yet, but the support coming
rig:
owner: repo-owner
name: gofish-rig
# Optionally a branch can be provided.
# Defaults to the default repository branch.
branch: main
# Optionally a token can be provided, if it differs from the token provided to GoReleaser
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
# Template for the url which is determined by the given Token (github or gitlab)
# Default for github is "https://github.com/<repo_owner>/<repo_name>/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
# Default for gitlab is "https://gitlab.com/<repo_owner>/<repo_name>/-/releases/{{ .Tag }}/downloads/{{ .ArtifactName }}"
# Default for gitea is "https://gitea.com/<repo_owner>/<repo_name>/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
url_template: "http://github.mycompany.com/foo/bar/releases/{{ .Tag }}/{{ .ArtifactName }}"
# Git author used to commit to the repository.
# Defaults are shown.
commit_author:
name: goreleaserbot
email: goreleaser@carlosbecker.com
# The project name and current git tag are used in the format string.
commit_msg_template: "GoFish fish food update for {{ .ProjectName }} version {{ .Tag }}"
# Your app's homepage.
# Default is empty.
homepage: "https://example.com/"
# Template of your app's description.
# Default is empty.
description: "Software to create fast and easy drum rolls."
# SPDX identifier of your app's license.
# Default is empty.
license: "MIT"
# Setting this will prevent goreleaser to actually try to commit the updated
# fish food - instead, the fish food file will be stored on the dist folder only,
# leaving the responsibility of publishing it to the user.
# If set to auto, the release will not be uploaded to the GoFish rig
# in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1
# Default is false.
skip_upload: true
```
!!! tip
Learn more about the [name template engine](/customization/templates/).
By defining the `rigs` section, GoReleaser will take care of publishing the
GoFish rig.
Assuming that the current tag is `v1.2.3`, the above configuration will generate a
`program.lua` fish food in the `Food` folder of `user/gofish-rig` repository:
```lua
local name = "Program"
local version = "1.2.3"
food = {
name = name,
description = "How to use this binary",
license = "MIT",
homepage = "https://github.com/user/repo",
version = version,
packages = {
{
os = "darwin",
arch = "amd64",
url = "https://github.com/user/repo/releases/download/v1.2.3/program_v1.2.3_macOs_64bit.zip",
sha256 = "9ee30fc358fae8d248a2d7538957089885da321dca3f09e3296fe2058e7fff74",
resources = {
{
path = name,
installpath = "bin/" .. name,
executable = true
}
}
}
}
}
```
## Limitations
- Only one `GOARM` build is allowed;

View File

@ -36,9 +36,16 @@ Description.
-->
### rigs
> since 2022-03-21 (v1.8.0)
GoFish was deprecated by their authors, therefore, we're removing its
support from GoReleaser too.
### dockers.use: buildpacks
> since 2022-03-16 (v1.6.0)
> since 2022-03-16 (v1.7.0)
This will be removed soon due to some issues:

View File

@ -31,20 +31,6 @@ Below you can find the steps for each of them.
The [formula in homebrew-core](https://github.com/Homebrew/homebrew-core/blob/master/Formula/goreleaser.rb) might be slightly outdated.
Use our homebrew tap to always get the latest updates.
### gofish
=== "OSS"
```sh
gofish rig add https://github.com/goreleaser/fish-food
gofish install github.com/goreleaser/fish-food/goreleaser
```
=== "Pro"
```sh
gofish rig add https://github.com/goreleaser/fish-food
gofish install github.com/goreleaser/fish-food/goreleaser-pro
```
### snapcraft
=== "OSS"

View File

@ -101,7 +101,6 @@ nav:
- customization/fury.md
- customization/homebrew.md
- customization/aur.md
- customization/gofish.md
- customization/krew.md
- customization/scoop.md
- customization/changelog.md