diff --git a/actions/alibaba-dragonwell-dependency/main.go b/actions/alibaba-dragonwell-dependency/main.go index e0b3714f..8e152796 100644 --- a/actions/alibaba-dragonwell-dependency/main.go +++ b/actions/alibaba-dragonwell-dependency/main.go @@ -73,7 +73,7 @@ func main() { for _, a := range r.Assets { if globRegex.MatchString(*a.Name) { version := tag[1] - if strings.HasPrefix(tag[1], "8u") { + if strings.HasPrefix(version, "8u") { version = fmt.Sprintf("8.0.%s", strings.TrimLeft(version, "8u")) } versions[version] = *a.BrowserDownloadURL diff --git a/actions/foojay-dependency/main.go b/actions/foojay-dependency/main.go index 4dbc7951..94f05aea 100644 --- a/actions/foojay-dependency/main.go +++ b/actions/foojay-dependency/main.go @@ -146,7 +146,7 @@ func LoadPackages(d string, t string, v int) actions.Versions { } versions[version] = LoadDownloadURI(result.Links.URI) } else { - fmt.Println(result.JavaVersion, "failed to parse") + panic(fmt.Errorf(result.JavaVersion, "failed to parse")) } } diff --git a/actions/graalvm-dependency/main.go b/actions/graalvm-dependency/main.go index d219142f..e10164f4 100644 --- a/actions/graalvm-dependency/main.go +++ b/actions/graalvm-dependency/main.go @@ -111,9 +111,7 @@ func main() { url := versions[latestVersion.Original()] - if productType == JDKProductType { - latestVersion = semver.MustParse(GetVersion(url)) - } + latestVersion = semver.MustParse(GetVersion(url)) outputs, err := actions.NewOutputs(url, latestVersion, nil) if err != nil { @@ -138,6 +136,9 @@ func main() { } func GetVersion(uri string) string { + // for native-image installer, we convert the URL to the graalvm-ce download URL to fetch the version + uri = strings.Replace(strings.Replace(uri, ".jar", ".tar.gz", 1), "native-image-installable-svm-", "graalvm-ce-", 1) + resp, err := http.Get(uri) if err != nil { panic(fmt.Errorf("unable to get %s\n%w", uri, err)) @@ -186,8 +187,3 @@ func GetVersion(uri string) string { panic(fmt.Errorf("unable to find file that matches %s", re.String())) } - -type Holder struct { - Assets []*github.ReleaseAsset - URI string -}