feat: add weiyun
support (close #4802 in #4883)
#329
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_lang | |
on: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- 'drivers/**' | |
- 'internal/bootstrap/data/setting.go' | |
- 'internal/conf/const.go' | |
- 'cmd/lang.go' | |
workflow_dispatch: | |
jobs: | |
auto_lang: | |
strategy: | |
matrix: | |
platform: [ ubuntu-latest ] | |
go-version: [ '1.20' ] | |
name: auto generate lang.json | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Setup go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout alist | |
uses: actions/checkout@v3 | |
with: | |
path: alist | |
- name: Checkout alist-web | |
uses: actions/checkout@v3 | |
with: | |
repository: 'alist-org/alist-web' | |
ref: main | |
persist-credentials: false | |
fetch-depth: 0 | |
path: alist-web | |
- name: Generate lang | |
run: | | |
cd alist | |
go run ./main.go lang | |
cd .. | |
- name: Copy lang file | |
run: | | |
cp -f ./alist/lang/*.json ./alist-web/src/lang/en/ 2>/dev/null || : | |
- name: Commit git | |
run: | | |
cd alist-web | |
git add . | |
git config --local user.email "[email protected]" | |
git config --local user.name "Andy Hsu" | |
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: alist-web | |
repository: alist-org/alist-web |