Skip to content

Commit

Permalink
Adjusts regular expressions to handle changes made to the Java 11 rel…
Browse files Browse the repository at this point in the history
…eases of Alibaba Dragonwell

Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
  • Loading branch information
Daniel Mikusa committed Aug 30, 2021
1 parent d5e6e79 commit c452d37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions actions/alibaba-dragonwell-dependency/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func main() {

candidates := make(map[string]Holder)
var candidateVersions []string
re := regexp.MustCompile(`dragonwell-(.+)_.+-ga`)
re := regexp.MustCompile(`(dragonwell-)?(\d+\.\d+\.\d+\.?\d*).*-(ga|GA)`)
opt := &github.ListOptions{PerPage: 100}
for {
rel, rsp, err := gh.Repositories.ListReleases(context.Background(), "alibaba", r, opt)
Expand All @@ -77,7 +77,7 @@ func main() {
for _, a := range r.Assets {
if g.MatchString(*a.Name) {
if g := re.FindStringSubmatch(*r.TagName); g != nil {
ver := g[1]
ver := g[2]
candidateVersions = append(candidateVersions, ver)
candidates[ver] = Holder{Assets: r.Assets, URI: *a.BrowserDownloadURL}
break
Expand Down Expand Up @@ -158,7 +158,7 @@ func GetVersion(assets []*github.ReleaseAsset) string {

var v string

re = regexp.MustCompile(`JAVA_VERSION="([\d]+)\.([\d]+)\.([\d]+)[_]?([\d]+)?"`)
re = regexp.MustCompile(`JAVA_VERSION="([\d]+)\.([\d]+)\.([\d]+)[\._]?([\d]+)?"`)
if g := re.FindStringSubmatch(string(b)); g != nil {
if g[2] == "8" {
v = fmt.Sprintf("8.0.%s", g[4])
Expand Down

0 comments on commit c452d37

Please sign in to comment.