Commit graph

113 commits

Author SHA1 Message Date
Berk D. Demir
38f5ff1dc5 Canonicalize versions with makeSemver in getInfoFromDist
While getInfoFromManifest stores semver versions in IGoVersionInfo
struct, getInfoFromDist uses "goX.Y.Z" versions with "go" prefix. To
make it consistent between two, convert versions from golang.org/dl
version registry to semver versions.
2020-12-16 15:07:50 -08:00
Berk D. Demir
47f75dda82 Cannot reuse IGoVersionInfo from dist for manifest
...and vice versa.

While here, also free versionInfo and versionSpec so we don't
(un)intentionally overwrite them somewhere down below.
2020-12-16 15:07:50 -08:00
Berk D. Demir
b9260615df Add version-resolver input
Tool cache can be stale in GitHub and self-hosted runners. If supplied
`go-version` is a semver range--instead of an explicit version--it will
be tried through the version inventory in cache, first. Even though
the GitHub local copy or origin distribution may have newer versions
matching the passed range, as long as the cache can satisfy the range,
the latest version from cache will be used.

Introduce an optional input, `version-resolver`. If defined, it tries to
resolve the version spec against either GitHub local copy or Go's
canonical source of version manifest.
If the value of `version-resolver` is:
  - "manifest": the manifest file under @actions/go-version get used.
  - "dist": the manifest at https://golang.org/dl/?mode=json&include=all
  gets used.  It can take values

Example:
--------
- Latest Go Version: 1.15.2
- tool-cache has go1.15 (1.15.0), latest.

build.yml:
```
[...]
  - uses: actions/setup-go@v2
    with:
      go-version: '>=1.5 <2'
[...]
```

Although the intention of the user might be to get latest
version between "oldest Go 1.15.0, newest--not inclusive--Go 2.0", the
cache will match this range with Go 1.15.0.

build.yml (v2):
```
[...]
  - uses: actions/setup-go@v2
    with:
      go-version: '>=1.5 <2'
      version-resolver: 'manifest'
[...]
```

With supplied version resolver, the semver range will be checked against
the local GitHub version manifest from @actions/go-versions[1], and
match 1.15.2. Cache will be queried with the resolved version, instead
of the range. When the cache gets updated globally, next runs will use
the tool from the cache, instead of downloading locally or in case of
resolver 'dist', directly from Google.

[1]: https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json

Closes #73
2020-12-16 15:07:50 -08:00
Josh Gross
3b4dc6cbed
Merge pull request #90 from actions/joshmgross/add-codeowners
Add CODEOWNERS
2020-12-09 11:22:47 -05:00
Josh Gross
afe68ffd57
Add CODEOWNERS 2020-12-07 15:56:41 -05:00
Thomas Boop
37335c7bb2
Swap to Environment Files (#76)
* Swap to env files
2020-10-01 10:45:00 -04:00
Thomas Boop
7ff6287c80
Merge pull request #70 from thboop/main
Add `Licensed` To Help Verify Prod Licenses
2020-09-10 09:23:38 -04:00
Thomas Boop
084110f6ed Ignore Generated Files in Git PR's 2020-08-26 11:22:18 -04:00
Thomas Boop
4047b11da0 Manually review dependencies 2020-08-11 20:55:26 -04:00
Thomas Boop
23a9878ae4 Add Licensed workflow and configuration files 2020-08-11 20:55:11 -04:00
Thomas Boop
8a3a76c217
Merge pull request #69 from actions/thboop/AddThirdPartyLicenses
Add Third Party License Information to Dist Files
2020-08-11 14:26:32 -04:00
Thomas Boop
a01ab08f9a Add Third Party License Information 2020-08-06 19:13:07 -04:00
Bryan MacFarlane
33cbf07c96 workflow main references 2020-07-22 08:04:56 -04:00
Bryan MacFarlane
8e98458ff1 updating matrix in readme 2020-07-22 07:52:29 -04:00
Maxim Lobanov
d0c5defdf3
Switch manifest installation from "master" to "main" branch (#65)
* switch from master to main branch

* Update README.md
2020-07-20 12:50:40 -04:00
Dmitry Shibanov
1616116e1b
Use GitHub releases to download Go versions. (#58) 2020-06-29 11:41:13 -04:00
Bryan MacFarlane
0f551ac199
Update v2 tags in readme 2020-04-16 18:52:49 -04:00
Bryan MacFarlane
e1c0a1665b
Update readme with v2 release 2020-04-16 18:52:17 -04:00
Bryan MacFarlane
78bd24e01a
Merge pull request #50 from actions/goenv
go env block
2020-04-06 09:29:27 -04:00
Bryan MacFarlane
6613fc89fc go env block 2020-04-06 08:42:55 -04:00
Bryan MacFarlane
202a594963
Merge pull request #48 from actions/matcher
More focused problem matcher regex
2020-04-03 11:51:07 -04:00
Bryan MacFarlane
0dbc7e4965 toString 2020-03-31 10:40:32 -04:00
Bryan MacFarlane
2091469f9f lint 2020-03-31 10:38:13 -04:00
Bryan MacFarlane
f32657ccaf output version of go it resolved to 2020-03-31 10:37:33 -04:00
Bryan MacFarlane
cec6ecefb4 output version of go it resolved to 2020-03-31 10:32:03 -04:00
Bryan MacFarlane
e36ce1d6cf tabs or spaces 2020-03-30 10:46:01 -04:00
Bryan MacFarlane
89c89c5036 cleaner regex 2020-03-30 10:39:29 -04:00
Bryan MacFarlane
0a62a734da another test case 2020-03-30 09:12:21 -04:00
Bryan MacFarlane
5156bc5dd3 lint 2020-03-27 20:21:13 -04:00
Bryan MacFarlane
7837b03976 more tests 2020-03-27 20:14:29 -04:00
Bryan MacFarlane
74c8095946 lint 2020-03-27 19:58:10 -04:00
Bryan MacFarlane
34223181a5 starting 2020-03-27 19:56:10 -04:00
Bryan MacFarlane
1c06f0e82e couple tests 2020-03-27 00:55:12 -04:00
Bryan MacFarlane
a030287975
Merge pull request #47 from actions/binpath
add bin to path
2020-03-26 14:08:44 -04:00
Bryan MacFarlane
3349559e91 fail on high severity 2020-03-26 14:00:03 -04:00
Bryan MacFarlane
dec4fc5647 update tool-cache version 2020-03-26 13:52:36 -04:00
Bryan MacFarlane
262468e92f only needed to do once 2020-03-26 13:46:15 -04:00
Bryan MacFarlane
4e8106ca18 create profiles go dir if go installed but not exists 2020-03-26 13:00:45 -04:00
Bryan MacFarlane
93ddff5bef lint 2020-03-26 12:55:08 -04:00
Bryan MacFarlane
3d89e603f2 more debug 2020-03-26 12:54:21 -04:00
Bryan MacFarlane
1fea44b3f0 create bin if not under go env GOPATH 2020-03-26 12:40:41 -04:00
Bryan MacFarlane
3e014ec8a4 lint 2020-03-26 12:23:38 -04:00
Bryan MacFarlane
75899f8cdf add debug 2020-03-26 12:17:32 -04:00
Bryan MacFarlane
1fdcb9b160 oops 2020-03-26 12:06:36 -04:00
Bryan MacFarlane
3d0e3826ed prefer globally installed bin 2020-03-26 12:02:52 -04:00
Bryan MacFarlane
9c31f591e9 add bin to path 2020-03-26 11:53:35 -04:00
Bryan MacFarlane
e0b6a4d694 audit fixes 2020-03-26 11:13:11 -04:00
Bryan MacFarlane
1295b8c552 fix version dir 2020-03-26 10:55:21 -04:00
Bryan MacFarlane
9b1c41166a fix version dir 2020-03-26 10:44:11 -04:00
Bryan MacFarlane
655555d319 fix cache dir issue 2020-03-26 10:38:51 -04:00