1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-04-13 11:50:34 +02:00

feat: Add persist definition to scoop manifest (#776)

This commit is contained in:
Grachev Mikhail 2018-08-25 23:24:42 +03:00 committed by Carlos Alexandro Becker
parent 6217d1e90d
commit da882e87fc
6 changed files with 21 additions and 2 deletions

View File

@ -101,6 +101,7 @@ type Manifest struct {
Homepage string `json:"homepage,omitempty"` // `homepage`: The home page for the program. 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. 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 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 // 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, Homepage: ctx.Config.Scoop.Homepage,
License: ctx.Config.Scoop.License, License: ctx.Config.Scoop.License,
Description: ctx.Config.Scoop.Description, Description: ctx.Config.Scoop.Description,
Persist: ctx.Config.Scoop.Persist,
} }
for _, artifact := range artifacts { for _, artifact := range artifacts {

View File

@ -410,6 +410,7 @@ func Test_buildManifest(t *testing.T) {
}, },
Description: "A run pipe test formula", Description: "A run pipe test formula",
Homepage: "https://github.com/goreleaser", 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", Description: "A run pipe test formula",
Homepage: "https://github.com/goreleaser", Homepage: "https://github.com/goreleaser",
URLTemplate: "http://github.mycompany.com/foo/bar/{{ .Tag }}/{{ .ArtifactName }}", URLTemplate: "http://github.mycompany.com/foo/bar/{{ .Tag }}/{{ .ArtifactName }}",
Persist: []string{"data.cfg", "etc"},
}, },
}, },
}, },

View File

@ -11,5 +11,10 @@
} }
}, },
"homepage": "https://github.com/goreleaser", "homepage": "https://github.com/goreleaser",
"description": "A run pipe test formula" "description": "A run pipe test formula",
"persist": [
"data",
"config",
"test.ini"
]
} }

View File

@ -11,5 +11,9 @@
} }
}, },
"homepage": "https://github.com/goreleaser", "homepage": "https://github.com/goreleaser",
"description": "A run pipe test formula" "description": "A run pipe test formula",
"persist": [
"data.cfg",
"etc"
]
} }

View File

@ -61,6 +61,7 @@ type Scoop struct {
Description string `yaml:",omitempty"` Description string `yaml:",omitempty"`
License string `yaml:",omitempty"` License string `yaml:",omitempty"`
URLTemplate string `yaml:"url_template,omitempty"` URLTemplate string `yaml:"url_template,omitempty"`
Persist []string `yaml:"persist,omitempty"`
} }
// CommitAuthor is the author of a Git commit // CommitAuthor is the author of a Git commit

View File

@ -40,6 +40,11 @@ scoop:
# Your app's license # Your app's license
# Default is empty. # Default is empty.
license: MIT license: MIT
# Persist data between application updates
persist:
- "data"
- "config.toml"
``` ```
By defining the `scoop` section, GoReleaser will take care of publishing the By defining the `scoop` section, GoReleaser will take care of publishing the