2021-11-03 17:44:08 +00:00
|
|
|
# Download translations from Crowdin and push to GitHub
|
|
|
|
|
|
|
|
name: Crowdin Daily Workflow
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * *' # every day at midnight
|
|
|
|
|
2022-07-01 05:43:08 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-11-03 17:44:08 +00:00
|
|
|
jobs:
|
|
|
|
sync:
|
2022-07-01 05:43:08 +00:00
|
|
|
permissions:
|
|
|
|
contents: write # for Git to git push
|
2021-11-03 17:44:08 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Setup Java JDK
|
2022-11-11 06:56:17 +00:00
|
|
|
uses: actions/setup-java@v3
|
2021-11-03 17:44:08 +00:00
|
|
|
with:
|
2022-11-11 06:56:17 +00:00
|
|
|
java-version: 18
|
|
|
|
distribution: zulu
|
2021-11-03 17:44:08 +00:00
|
|
|
- name: Setup Python
|
2022-11-11 06:56:17 +00:00
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: '3.10'
|
2021-11-03 17:44:08 +00:00
|
|
|
- name: Checkout
|
2022-11-11 06:56:17 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-11-03 17:44:08 +00:00
|
|
|
- name: Crowdin Sync
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
|
|
|
|
run: |
|
|
|
|
cd intl
|
2021-11-07 02:55:35 +00:00
|
|
|
python3 -m pip install requests PyYAML
|
2021-11-03 17:44:08 +00:00
|
|
|
python3 crowdin_sync.py "$CROWDIN_API_KEY"
|
|
|
|
git config user.name github-actions
|
|
|
|
git config user.email github-actions@github.com
|
|
|
|
git add .
|
|
|
|
git commit -m "Fetch translations from Crowdin"
|
|
|
|
git push
|