3
0
Fork 0
mirror of https://gitea.com/actions/setup-go.git synced 2024-11-22 09:39:31 +01:00

Bump GitHub actions, README.md cleanups (#202)

* Bump `actions/checkout@v3`

* Bump `actions/setup-node@v3`

* Bump `actions/upload-artifact@v3`

* Bump `actions/setup-go@v3` in `README.md` examples

* Removed mention of `stable` action argument from `README.md`

* Add "new style" workflow build buttons to `README.md`
This commit is contained in:
Peter Mescalchin 2022-04-01 06:29:52 +11:00 committed by GitHub
parent 341b20ac36
commit dcb4ec94ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 26 deletions

View file

@ -21,10 +21,10 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set Node.js 16.x - name: Set Node.js 16.x
uses: actions/setup-node@v2 uses: actions/setup-node@v3
with: with:
node-version: 16.x node-version: 16.x
@ -44,7 +44,7 @@ jobs:
id: diff id: diff
# If index.js was different than expected, upload the expected version as an artifact # If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }} if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with: with:
name: dist name: dist

View file

@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Check licenses name: Check licenses
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set Node.js 16.x - name: Set Node.js 16.x
uses: actions/setup-node@v2 uses: actions/setup-node@v3
with: with:
node-version: 16.x node-version: 16.x
- run: npm ci - run: npm ci

View file

@ -22,7 +22,7 @@ jobs:
go: [1.12, 1.13, 1.14] go: [1.12, 1.13, 1.14]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: setup-go ${{ matrix.go }} - name: setup-go ${{ matrix.go }}
uses: ./ uses: ./
@ -41,7 +41,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest] os: [ubuntu-latest, windows-latest, macos-latest]
go-version: [1.16, 1.17] go-version: [1.16, 1.17]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Setup Go and check latest - name: Setup Go and check latest
uses: ./ uses: ./
with: with:
@ -60,13 +60,13 @@ jobs:
go: [1.12.16, 1.13.11, 1.14.3] go: [1.12.16, 1.13.11, 1.14.3]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: setup-go ${{ matrix.go }} - name: setup-go ${{ matrix.go }}
uses: ./ uses: ./
with: with:
go-version: ${{ matrix.go }} go-version: ${{ matrix.go }}
- name: verify go - name: verify go
run: __tests__/verify-go.sh ${{ matrix.go }} run: __tests__/verify-go.sh ${{ matrix.go }}
shell: bash shell: bash
@ -81,7 +81,7 @@ jobs:
go: [1.9, 1.8.6] go: [1.9, 1.8.6]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: setup-go ${{ matrix.go }} - name: setup-go ${{ matrix.go }}
uses: ./ uses: ./

View file

@ -17,10 +17,10 @@ jobs:
operating-system: [ubuntu-latest, windows-latest] operating-system: [ubuntu-latest, windows-latest]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Setup node 16 - name: Setup node 16
uses: actions/setup-node@v2 uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: 16
cache: npm cache: npm

View file

@ -1,27 +1,26 @@
# setup-go # setup-go
<p align="left"> [![build-test](https://github.com/actions/setup-go/actions/workflows/workflow.yml/badge.svg)](https://github.com/actions/setup-go/actions/workflows/workflow.yml)
<a href="https://github.com/actions/setup-go/actions"><img alt="GitHub Actions status" src="https://github.com/actions/setup-go/workflows/build-test/badge.svg"></a> [![Validate 'setup-go'](https://github.com/actions/setup-go/actions/workflows/versions.yml/badge.svg)](https://github.com/actions/setup-go/actions/workflows/versions.yml)
<a href="https://github.com/actions/setup-go/actions"><img alt="versions status" src="https://github.com/actions/setup-go/workflows/go-versions/badge.svg"></a>
</p>
This action sets up a go environment for use in actions by: This action sets up a go environment for use in actions by:
- optionally downloading and caching a version of Go by version and adding to PATH - Optionally downloading and caching a version of Go by version and adding to `PATH`.
- registering problem matchers for error output - Registering problem matchers for error output.
# V3 # V3
The V3 offers: The V3 edition of the action offers:
- Adds GOBIN to the PATH
- Proxy Support - Adds `GOBIN` to the `PATH`
- Proxy support
- Check latest version - Check latest version
- Bug Fixes (including issues around version matching and semver) - Bug fixes (including issues around version matching and semver)
The action will first check the local cache for a version match. If a version is not found locally, it will pull it from the `main` branch of the [go-versions](https://github.com/actions/go-versions/blob/main/versions-manifest.json) repository. On miss or failure, it will fall back to downloading directly from [go dist](https://storage.googleapis.com/golang). To change the default behavior, please use the [check-latest input](#check-latest-version). The action will first check the local cache for a version match. If a version is not found locally, it will pull it from the `main` branch of the [go-versions](https://github.com/actions/go-versions/blob/main/versions-manifest.json) repository. On miss or failure, it will fall back to downloading directly from [go dist](https://storage.googleapis.com/golang). To change the default behavior, please use the [check-latest input](#check-latest-version).
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@v3 - uses: actions/checkout@v3
@ -64,6 +63,7 @@ steps:
See [action.yml](action.yml) See [action.yml](action.yml)
## Basic: ## Basic:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -74,7 +74,7 @@ steps:
``` ```
## Check latest version: ## Check latest version:
The `check-latest` flag defaults to `false`. Use the default or set `check-latest` to `false` if you prefer stability and if you want to ensure a specific Go version is always used. The `check-latest` flag defaults to `false`. Use the default or set `check-latest` to `false` if you prefer stability and if you want to ensure a specific Go version is always used.
@ -93,6 +93,7 @@ steps:
``` ```
## Matrix Testing: ## Matrix Testing:
```yaml ```yaml
jobs: jobs:
build: build:
@ -111,9 +112,10 @@ 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-rc.2`, `1.16.0-beta.1` 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`, `>=1.18.0-rc.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