mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
build: fix golang build cache
This commit is contained in:
parent
4e5bdec13a
commit
c34c5ff1f9
12
.github/workflows/build.yaml
vendored
12
.github/workflows/build.yaml
vendored
|
@ -5,12 +5,14 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/setup-go@v1
|
uses: actions/checkout@v3
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: '1.19'
|
||||||
- name: Check out code
|
check-latest: true
|
||||||
uses: actions/checkout@v1
|
cache: true
|
||||||
- name: Build
|
- name: Build
|
||||||
run: make all
|
run: make all
|
||||||
- name: Release
|
- name: Release
|
||||||
|
|
21
.github/workflows/prerelease.yml
vendored
21
.github/workflows/prerelease.yml
vendored
|
@ -12,26 +12,15 @@ jobs:
|
||||||
Build:
|
Build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- 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@v3
|
|
||||||
with:
|
|
||||||
go-version: ${{ steps.version.outputs.go_version }}
|
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Cache go module
|
- name: Setup Go
|
||||||
uses: actions/cache@v2
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
path: ~/go/pkg/mod
|
go-version: '1.19'
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
check-latest: true
|
||||||
restore-keys: |
|
cache: true
|
||||||
${{ runner.os }}-go-
|
|
||||||
|
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
if: ${{github.ref_name=='Beta'}}
|
if: ${{github.ref_name=='Beta'}}
|
||||||
|
|
22
.github/workflows/release.yaml
vendored
22
.github/workflows/release.yaml
vendored
|
@ -7,24 +7,16 @@ jobs:
|
||||||
Build:
|
Build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- 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@v2
|
|
||||||
with:
|
|
||||||
go-version: ${{ steps.version.outputs.go_version }}
|
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Cache go module
|
|
||||||
uses: actions/cache@v2
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
path: ~/go/pkg/mod
|
go-version: '1.19'
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
check-latest: true
|
||||||
restore-keys: |
|
cache: true
|
||||||
${{ runner.os }}-go-
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
go test ./...
|
go test ./...
|
||||||
|
|
Loading…
Reference in New Issue
Block a user