fix: don't select installers
ci/woodpecker/push/goreleaser Pipeline was successful Details
ci/woodpecker/tag/goreleaser Pipeline was successful Details

Signed-off-by: jolheiser <john.olheiser@gmail.com>
main v0.0.2
jolheiser 2023-01-18 13:18:23 -06:00
parent 1528f971fa
commit ca426d5fd2
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
1 changed files with 5 additions and 4 deletions

View File

@ -10,9 +10,10 @@ import (
)
var (
amd64Re = regexp.MustCompile(`amd64|x86_64|64-bit|[^mhv]64`)
linuxRe = regexp.MustCompile(`linux`)
windowsRe = regexp.MustCompile(`windows|\Awin`)
amd64Re = regexp.MustCompile(`amd64|x86_64|64-bit|[^mhv]64`)
linuxRe = regexp.MustCompile(`linux`)
windowsRe = regexp.MustCompile(`windows|\Awin`)
installerRe = regexp.MustCompile(`\.deb|\.msi`)
)
type Release struct {
@ -99,7 +100,7 @@ func LatestRelease(f Forger) (Asset, error) {
}
for _, a := range release.Assets {
if amd64Re.MatchString(a.Name) && re.MatchString(a.Name) {
if amd64Re.MatchString(a.Name) && re.MatchString(a.Name) && !installerRe.MatchString(a.Name) {
fmt.Printf("found %q\n", a.Name)
asset = a
break