idl_update #213
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Fetch Branch | |
continue-on-error: true | |
run: git fetch origin ${{ github.event.client_payload.ref }} | |
- 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 | |
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/kitex@latest | |
goctl env check --install --verbose --force | |
- name: Update | |
run: | | |
rm -r kitex_gen | |
export IDL_DIR=./service-idl | |
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 }} |