diff --git a/internal/pipeline/scoop/scoop.go b/internal/pipeline/scoop/scoop.go index 3e90849e1..38e785158 100644 --- a/internal/pipeline/scoop/scoop.go +++ b/internal/pipeline/scoop/scoop.go @@ -101,6 +101,7 @@ type Manifest struct { Homepage string `json:"homepage,omitempty"` // `homepage`: The home page for the program. License string `json:"license,omitempty"` // `license`: The software license for the program. For well-known licenses, this will be a string like "MIT" or "GPL2". For custom licenses, this should be the URL of the license. Description string `json:"description,omitempty"` // Description of the app + Persist []string `json:"persist,omitempty"` // Persist data between updates } // Resource represents a combination of a url and a binary name for an architecture @@ -117,6 +118,7 @@ func buildManifest(ctx *context.Context, artifacts []artifact.Artifact) (bytes.B Homepage: ctx.Config.Scoop.Homepage, License: ctx.Config.Scoop.License, Description: ctx.Config.Scoop.Description, + Persist: ctx.Config.Scoop.Persist, } for _, artifact := range artifacts { diff --git a/internal/pipeline/scoop/scoop_test.go b/internal/pipeline/scoop/scoop_test.go index ca53c29cf..bafa20c6c 100644 --- a/internal/pipeline/scoop/scoop_test.go +++ b/internal/pipeline/scoop/scoop_test.go @@ -410,6 +410,7 @@ func Test_buildManifest(t *testing.T) { }, Description: "A run pipe test formula", Homepage: "https://github.com/goreleaser", + Persist: []string{"data", "config", "test.ini"}, }, }, }, @@ -448,6 +449,7 @@ func Test_buildManifest(t *testing.T) { Description: "A run pipe test formula", Homepage: "https://github.com/goreleaser", URLTemplate: "http://github.mycompany.com/foo/bar/{{ .Tag }}/{{ .ArtifactName }}", + Persist: []string{"data.cfg", "etc"}, }, }, }, diff --git a/internal/pipeline/scoop/testdata/test_buildmanifest.json.golden b/internal/pipeline/scoop/testdata/test_buildmanifest.json.golden index e56b31abd..2ad601a78 100644 --- a/internal/pipeline/scoop/testdata/test_buildmanifest.json.golden +++ b/internal/pipeline/scoop/testdata/test_buildmanifest.json.golden @@ -11,5 +11,10 @@ } }, "homepage": "https://github.com/goreleaser", - "description": "A run pipe test formula" + "description": "A run pipe test formula", + "persist": [ + "data", + "config", + "test.ini" + ] } \ No newline at end of file diff --git a/internal/pipeline/scoop/testdata/test_buildmanifest_url_template.json.golden b/internal/pipeline/scoop/testdata/test_buildmanifest_url_template.json.golden index d28e66999..f1e2dcc59 100644 --- a/internal/pipeline/scoop/testdata/test_buildmanifest_url_template.json.golden +++ b/internal/pipeline/scoop/testdata/test_buildmanifest_url_template.json.golden @@ -11,5 +11,9 @@ } }, "homepage": "https://github.com/goreleaser", - "description": "A run pipe test formula" + "description": "A run pipe test formula", + "persist": [ + "data.cfg", + "etc" + ] } \ No newline at end of file diff --git a/pkg/config/config.go b/pkg/config/config.go index 9cc5ae2f6..3510fdc00 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -61,6 +61,7 @@ type Scoop struct { Description string `yaml:",omitempty"` License string `yaml:",omitempty"` URLTemplate string `yaml:"url_template,omitempty"` + Persist []string `yaml:"persist,omitempty"` } // CommitAuthor is the author of a Git commit diff --git a/www/content/scoop.md b/www/content/scoop.md index 986cf651d..d830155b9 100644 --- a/www/content/scoop.md +++ b/www/content/scoop.md @@ -40,6 +40,11 @@ scoop: # Your app's license # Default is empty. license: MIT + + # Persist data between application updates + persist: + - "data" + - "config.toml" ``` By defining the `scoop` section, GoReleaser will take care of publishing the