mirror of
https://github.com/actions/setup-go.git
synced 2024-12-27 08:41:03 +08:00
Update usage examples on readme (#212)
* Fix action usage examples on readme * Revert changes on package-lock * Fix some checkout action version
This commit is contained in:
parent
a5865a93f2
commit
341b20ac36
35
README.md
35
README.md
@ -24,21 +24,38 @@ The action will first check the local cache for a version match. If a version is
|
|||||||
Matching by [semver spec](https://github.com/npm/node-semver):
|
Matching by [semver spec](https://github.com/npm/node-semver):
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v3
|
- uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: '^1.13.1' # The Go version to download (if necessary) and use.
|
go-version: '^1.13.1' # The Go version to download (if necessary) and use.
|
||||||
- run: go version
|
- run: go version
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: '>=1.17.0'
|
||||||
|
- run: go version
|
||||||
|
```
|
||||||
|
|
||||||
Matching an unstable pre-release:
|
Matching an unstable pre-release:
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v3
|
- uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
stable: 'false'
|
go-version: '1.18.0-rc.1' # The Go version to download (if necessary) and use.
|
||||||
go-version: '1.14.0-rc1' # The Go version to download (if necessary) and use.
|
- run: go version
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: '1.16.0-beta.1' # The Go version to download (if necessary) and use.
|
||||||
- run: go version
|
- run: go version
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -49,7 +66,7 @@ See [action.yml](action.yml)
|
|||||||
## Basic:
|
## Basic:
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v3
|
- uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: '1.16.1' # The Go version to download (if necessary) and use.
|
go-version: '1.16.1' # The Go version to download (if necessary) and use.
|
||||||
@ -67,7 +84,7 @@ If `check-latest` is set to `true`, the action first checks if the cached versio
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v3
|
- uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: '1.14'
|
go-version: '1.14'
|
||||||
@ -85,7 +102,7 @@ jobs:
|
|||||||
go: [ '1.14', '1.13' ]
|
go: [ '1.14', '1.13' ]
|
||||||
name: Go ${{ matrix.go }} sample
|
name: Go ${{ matrix.go }} sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
@ -96,8 +113,8 @@ jobs:
|
|||||||
### Supported version syntax
|
### Supported version syntax
|
||||||
The `go-version` input supports the following syntax:
|
The `go-version` input supports the following syntax:
|
||||||
|
|
||||||
Specific versions: `1.15`, `1.16.1`, `1.17.0-rc2`, `1.16.0-beta1`
|
Specific versions: `1.15`, `1.16.1`, `1.17.0-rc.2`, `1.16.0-beta.1`
|
||||||
SemVer's version range syntax: `^1.13.1`
|
SemVer's version range syntax: `^1.13.1`, `>=1.18.0-rc.1`
|
||||||
For more information about semantic versioning please refer [semver](https://github.com/npm/node-semver) documentation
|
For more information about semantic versioning please refer [semver](https://github.com/npm/node-semver) documentation
|
||||||
|
|
||||||
# License
|
# License
|
||||||
|
Loading…
x
Reference in New Issue
Block a user