-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.82 KB
/
update.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: Update
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
repository_dispatch:
types: [ idl_update ]
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout Branch
run: git checkout ${{ github.event.client_payload.ref }} || git checkout -b ${{ github.event.client_payload.ref }}
- name: Checkout IDL repository
uses: actions/checkout@v3
with:
repository: ${{ github.event.client_payload.repository }}
ref: ${{ github.event.client_payload.ref }}
path: service-idl-go
token: ${{ secrets.ACCESS_TOKEN }}
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: Install Protobuf Compiler
run: |
go install github.com/zeromicro/go-zero/tools/goctl@latest
go install github.com/cloudwego/kitex/tool/cmd/[email protected]
goctl env check --install --verbose --force
- name: Update
run: |
rm -r kitex_gen
export IDL_DIR=./service-idl-go
chmod 755 /home/runner/go/bin/protoc
sh build.sh
- name: Commit And Push
run: |
git config --global user.email "[email protected]"
git config --global user.name "${{ github.actor }}"
git add kitex_gen
git commit -m "${{ github.event.client_payload.commit_msg }}"
git push origin ${{ github.event.client_payload.ref }}