Skip to content

Commit

Permalink
fix: Scoop releases being skipped via disabled SCM releases (#4150)
Browse files Browse the repository at this point in the history
The check to skip Scoop releases when SCM ones are disabled seems to be
the only place where this is happening and in conflict to Brew releases.
These two need not be linked as users can configure the `url_template`
to point elsewhere.

--- 

Consider the following use case:

```
 * goreleaser/my-app.yml
   - builds: spec for building a Go binary for my-app
   - dockers: spec for packaging my-app in a container and pushing to Artifactory & GCP
   - archives: spec for zipping up my-app binary
   - artifactories: spec for pushing archives of my-app to a private jfrog artifactory
   - brews: spec for publishing my-app through brew on macOS with URLs from artifactory
   - scoop: spec for publishing my-app through scoop on Windows with URLs from artifactory
   - release: disabled SCM (e.g. GitHub) release
```

Running `goreleaser release -f goreleaser/my-app.yml` with the above
setup results in the correct artifacts (archives & containers) being
published to Artifactory, GCP, Brew, but no Scoop.

Given that Scoop's `skip_upload` cannot be templated in 1.18 and I do
not wish to have SCM releases & tags on every release, one can be rather
stuck.
  • Loading branch information
radujipa committed Jun 28, 2023
1 parent 323dca8 commit 3d77e8e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
8 changes: 0 additions & 8 deletions internal/pipe/scoop/scoop.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,6 @@ func doPublish(ctx *context.Context, manifest *artifact.Artifact, cl client.Clie
return pipe.Skip("release is prerelease")
}

relDisabled, err := tmpl.New(ctx).Bool(ctx.Config.Release.Disable)
if err != nil {
return err
}
if relDisabled {
return pipe.Skip("release is disabled")
}

commitMessage, err := tmpl.New(ctx).Apply(scoop.CommitMessageTemplate)
if err != nil {
return err
Expand Down
32 changes: 0 additions & 32 deletions internal/pipe/scoop/scoop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,38 +514,6 @@ func Test_doRun(t *testing.T) {
shouldErr("scoop.skip_upload is true"),
noAssertions,
},
{
"release is disabled",
args{
testctx.NewWithCfg(
config.Project{
ProjectName: "run-pipe",
Release: config.Release{
Disable: "true",
},
Scoop: config.Scoop{
Repository: config.RepoRef{
Owner: "test",
Name: "test",
},
Description: "A run pipe test formula",
Homepage: "https://github.com/goreleaser",
},
},
testctx.GitHubTokenType,
testctx.WithCurrentTag("v1.0.1"),
testctx.WithVersion("1.0.1"),
),
client.NewMock(),
},
[]artifact.Artifact{
{Name: "foo_1.0.1_windows_amd64.tar.gz", Goos: "windows", Goarch: "amd64", Goamd64: "v1", Path: file},
{Name: "foo_1.0.1_windows_386.tar.gz", Goos: "windows", Goarch: "386", Path: file},
},
shouldNotErr,
shouldErr("release is disabled"),
noAssertions,
},
{
"no archive",
args{
Expand Down

0 comments on commit 3d77e8e

Please sign in to comment.