Fix release by using github action

This commit is contained in:
Michael 2024-12-06 16:56:06 +01:00 committed by GitHub
parent 2df655cefe
commit 42df9afeaf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 210 additions and 122 deletions

View file

@ -25,14 +25,22 @@ func main() {
ParseFiles("./.goreleaser.yml.tmpl"),
)
outputPath := path.Join(os.TempDir(), fmt.Sprintf(".goreleaser_%s.yml", goos))
goarch := ""
outputFileName := fmt.Sprintf(".goreleaser_%s.yml", goos)
if strings.Contains(goos, "-") {
split := strings.Split(goos, "-")
goos = split[0]
goarch = split[1]
}
outputPath := path.Join(os.TempDir(), outputFileName)
output, err := os.Create(outputPath)
if err != nil {
log.Fatal(err)
}
err = tmpl.Execute(output, map[string]string{"GOOS": goos})
err = tmpl.Execute(output, map[string]string{"GOOS": goos, "GOARCH": goarch})
if err != nil {
log.Fatal(err)
}