Skip to content

Commit

Permalink
Issue #111: Adoptium actions adds source
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonydahanne committed Sep 26, 2023
1 parent d5490b6 commit 290b379
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion actions/adoptium-dependency/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,18 @@ func main() {
}

versions := make(actions.Versions)
additionalOutputs := make(actions.Outputs)
for _, r := range raw {
versions[strings.ReplaceAll(r.VersionData.Semver, "+", "-")] = r.Binaries[0].Package.Link
additionalOutputs["source"] = r.Source.Link
}

latestVersion, err := versions.GetLatestVersion(inputs)
if err != nil {
panic(fmt.Errorf("unable to get latest version\n%w", err))
}

outputs, err := actions.NewOutputs(versions[latestVersion.Original()], latestVersion, nil)
outputs, err := actions.NewOutputs(versions[latestVersion.Original()], latestVersion, additionalOutputs)
if err != nil {
panic(fmt.Errorf("unable to create outputs\n%w", err))
}
Expand All @@ -98,6 +100,7 @@ func main() {
type Asset struct {
Binaries []Binary
VersionData VersionData `json:"version_data"`
Source Source
}

type Binary struct {
Expand All @@ -108,6 +111,10 @@ type Package struct {
Link string
}

type Source struct {
Link string
}

type VersionData struct {
Semver string
}

0 comments on commit 290b379

Please sign in to comment.