Fix actions/setup-go usage

This commit is contained in:
世界 2024-01-24 11:53:34 +08:00
parent 3ac055b755
commit 45f572495e
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
2 changed files with 7 additions and 11 deletions

View file

@ -24,7 +24,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ">=1.21.0 <1.22.0"
go-version: ^1.21
- name: Add cache to Go proxy
run: |
version=`git rev-parse HEAD`
@ -48,7 +48,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ">=1.18.0 <1.19.0"
go-version: ~1.18
continue-on-error: true
- name: Build
run: |
@ -64,7 +64,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ">=1.19.0 <1.20.0"
go-version: ~1.19
continue-on-error: true
- name: Build
run: |
@ -80,7 +80,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ">=1.20.0 <1.21.0"
go-version: ~1.20
continue-on-error: true
- name: Build
run: |
@ -96,7 +96,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ">=1.21.0 <1.22.0"
go-version: ^1.21
continue-on-error: true
- name: Build
run: |
@ -112,7 +112,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ">=1.21.0 <1.22.0"
go-version: ^1.21
continue-on-error: true
- name: Build
run: |

View file

@ -21,14 +21,10 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get latest go version
id: version
run: |
echo ::set-output name=go_version::$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g')
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ steps.version.outputs.go_version }}
go-version: ^1.21
- name: Cache go module
uses: actions/cache@v3
with: