-
Notifications
You must be signed in to change notification settings - Fork 5
60 lines (54 loc) · 1.63 KB
/
buf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: check buf generate up to date
on:
push:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: load Go 1.22 env
uses: actions/setup-go@v3
with:
go-version: 1.22
id: go
- name: checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT }}
- uses: actions/cache@v3
id: cache-golang
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/go/bin
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: echo ${{ steps.cache-golang.outputs.cache-hit }}
- name: init dependance
if: steps.cache-golang.outputs.cache-hit != 'true'
run: make install-tools
- name: generate proto
run: make generate-proto
- name: check if files up to date
run: |
if [[ `git status --porcelain` ]]; then
git config --global user.name 'FDKevin'
git config --global user.email '[email protected]'
git add -A
git commit -m "ci(gen): buf generate up to date"
git push
fi
- name: warming go proxy
run: |
hash=$(git show -s --format=%h)
echo $hash
mkdir ~/warm
cd ~/warm
go mod init warm
go get github.com/hduhelp/api_open_sdk@$hash
GOPROXY=https://goproxy.io,direct go get github.com/hduhelp/api_open_sdk@$hash
GOPROXY=https://goproxy.cn,direct go get github.com/hduhelp/api_open_sdk@$hash