You've already forked goreleaser
mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-11-06 09:09:29 +02:00
feat: back-reference build artifacts from archive artifact (#908)
This commit is contained in:
committed by
GitHub
parent
e1eeba292f
commit
850205abf1
@@ -64,13 +64,13 @@ func New(ctx *context.Context) *Template {
|
||||
// WithArtifact populates fields from the artifact and replacements
|
||||
func (t *Template) WithArtifact(a artifact.Artifact, replacements map[string]string) *Template {
|
||||
var bin = a.Extra[binary]
|
||||
if bin == "" {
|
||||
bin = t.fields[projectName].(string)
|
||||
if bin == nil {
|
||||
bin = t.fields[projectName]
|
||||
}
|
||||
t.fields[os] = replace(replacements, a.Goos)
|
||||
t.fields[arch] = replace(replacements, a.Goarch)
|
||||
t.fields[arm] = replace(replacements, a.Goarm)
|
||||
t.fields[binary] = bin
|
||||
t.fields[binary] = bin.(string)
|
||||
t.fields[artifactName] = a.Name
|
||||
return t
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ func TestWithArtifact(t *testing.T) {
|
||||
Goarch: "amd64",
|
||||
Goos: "linux",
|
||||
Goarm: "6",
|
||||
Extra: map[string]string{
|
||||
Extra: map[string]interface{}{
|
||||
"Binary": "binary",
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user