Files
OpenList/.github/workflows/auto_lang.yml
Suyunmeng d95c4f0127 chore: change the CDN link of the logo and modify the OCR port (#84)
* Change the CDN link of the logo and modify the OCR port

* Update

* Rollback OCR interface
2025-06-15 23:19:25 +08:00

73 lines
1.9 KiB
YAML

name: auto_lang
on:
# Disable translation generation, enable it after everything is setup.
# push:
# branches:
# - 'main'
# paths:
# - 'drivers/**'
# - 'internal/bootstrap/data/setting.go'
# - 'internal/conf/const.go'
# - 'cmd/lang.go'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
auto_lang:
strategy:
matrix:
platform: [ ubuntu-latest ]
go-version: [ '1.21' ]
name: auto generate lang.json
runs-on: ${{ matrix.platform }}
steps:
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout alist
uses: actions/checkout@v4
with:
path: openlist
- name: Checkout openlist-frontend
uses: actions/checkout@v4
with:
repository: 'OpenListTeam/OpenList-Frontend'
ref: main
persist-credentials: false
fetch-depth: 0
path: OpenList-Frontend
- name: Generate lang
run: |
cd openlist
go run ./main.go lang
cd ..
- name: Copy lang file
run: |
cp -f ./openlist/lang/*.json ./OpenList-Frontend/src/lang/en/ 2>/dev/null || :
- name: Commit git
run: |
cd OpenList-Frontend
git add .
git config --local user.email "bot@openlist.team"
git config --local user.name "The OpenList Bot"
git commit -m "chore: auto update i18n file" -a 2>/dev/null || :
cd ..
- name: Push lang files
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.MY_TOKEN }}
branch: main
directory: OpenList-Frontend
repository: OpenListTeam/OpenList-Frontend