🤖 Auto Liqi #48
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: 🤖 Auto Liqi | |
on: | |
schedule: | |
- cron: "0 12 * * *" | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
auto-liqi: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install requests | |
run: python -m pip install --upgrade pip requests | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
- name: Install protobufjs and protobufjs-cli | |
run: npm install -g protobufjs protobufjs-cli | |
- name: Run get_liqi.py | |
run: python ./MajsoulUID/utils/proto/get_liqi.py | |
- name: Generate liqi.proto from liqi.json | |
run: pbjs -t proto3 liqi.json > liqi.proto | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
version: "v28.2" | |
- name: Install betterproto | |
run: python -m pip install betterproto[compiler] --pre | |
- name: Make lib directory | |
run: mkdir -p MajsoulUID/lib | |
- name: Generate python code from liqi.proto | |
run: protoc -I . --python_betterproto_out=./MajsoulUID/lib liqi.proto | |
- name: Remove files | |
run: rm -f liqi.json liqi.proto | |
- name: Set up Git | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email [email protected] | |
- name: Check if there are any changes | |
run: git diff --exit-code || git commit -am "🤖 自动更新 `Liqi`" && git push |