setup-go/action.yml

18 lines
731 B
YAML
Raw Normal View History

2019-08-12 14:41:23 -04:00
name: 'Setup Go environment'
2020-02-09 08:44:32 -05:00
description: 'Setup a Go environment and add it to the PATH'
2019-06-19 09:44:17 -04:00
author: 'GitHub'
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-09-13 18:59:29 -07:00
inputs:
2019-08-13 16:31:11 -04:00
go-version:
2020-02-09 00:21:39 -05:00
description: 'The Go version to download (if necessary) and use. Supports semver spec and ranges.'
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-09-13 18:59:29 -07:00
version-resolver:
description: 'Version inventory for resolving semver ranges before checking tool cache. Use "manifest" for @actions/go-versions, or "dist" for golang.org/dl'
2020-02-09 00:21:39 -05:00
stable:
description: 'Whether to download only stable versions'
default: 'true'
token:
description: Used to pull node distributions from go-versions. Since there's a default, this is typically not supplied by the user.
default: ${{ github.token }}
2019-06-19 09:44:17 -04:00
runs:
2019-07-09 12:44:13 -04:00
using: 'node12'
2020-02-09 00:21:39 -05:00
main: 'dist/index.js'