2021-11-12 21:54:17 +00:00
|
|
|
# Download translations form Crowdin & Recreate libretro_core_options_intl.h
|
2021-08-29 12:37:27 +00:00
|
|
|
|
|
|
|
name: Crowdin Translation Integration
|
|
|
|
|
|
|
|
on:
|
2021-11-12 21:54:17 +00:00
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * *' # every day at midnight
|
2021-08-29 12:37:27 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
create_intl_file:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-11-12 21:54:17 +00:00
|
|
|
- name: Setup Java JDK
|
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: 1.8
|
|
|
|
|
2021-08-29 12:37:27 +00:00
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v2
|
2021-11-12 21:54:17 +00:00
|
|
|
|
2021-08-29 12:37:27 +00:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
|
|
|
|
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
|
|
|
|
|
|
|
|
- name: Create intl file
|
|
|
|
shell: bash
|
2021-11-12 21:54:17 +00:00
|
|
|
env:
|
|
|
|
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
|
2021-08-29 12:37:27 +00:00
|
|
|
run: |
|
2021-11-12 21:54:17 +00:00
|
|
|
python3 intl/translation_workflow.py "$CROWDIN_API_KEY" "gambatte-libretro" "libgambatte/libretro"
|
2021-08-29 12:37:27 +00:00
|
|
|
|
|
|
|
- name: Commit files
|
|
|
|
run: |
|
2021-11-12 21:54:17 +00:00
|
|
|
git config --local user.email "github-actions@github.com"
|
2021-08-29 12:37:27 +00:00
|
|
|
git config --local user.name "github-actions[bot]"
|
2021-11-12 21:54:17 +00:00
|
|
|
git add intl/translation_workflow.py "libgambatte/libretro/libretro_core_options_intl.h"
|
|
|
|
git commit -m "Fetch translations & Recreate libretro_core_options_intl.h"
|
2021-08-29 12:37:27 +00:00
|
|
|
|
|
|
|
- name: GitHub Push
|
|
|
|
uses: ad-m/github-push-action@v0.6.0
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
branch: ${{ github.ref }}
|