2022-01-10 17:26:36 +00:00
|
|
|
# Download translations form Crowdin & Recreate libretro_core_options_intl.h
|
|
|
|
|
|
|
|
name: Crowdin Translation Integration
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
# please choose a random time & weekday to avoid all repos synching at the same time
|
2022-11-27 11:36:57 +00:00
|
|
|
- cron: '10 11 * * 5' # Fridays at 11:10 AM, UTC
|
2022-01-10 17:26:36 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
create_intl_file:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Setup Java JDK
|
2022-11-27 11:36:57 +00:00
|
|
|
uses: actions/setup-java@v3
|
2022-01-10 17:26:36 +00:00
|
|
|
with:
|
2022-11-27 11:36:57 +00:00
|
|
|
java-version: 18
|
|
|
|
distribution: zulu
|
2022-01-10 17:26:36 +00:00
|
|
|
|
|
|
|
- name: Setup Python
|
2022-11-27 11:36:57 +00:00
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: '3.10'
|
2022-01-10 17:26:36 +00:00
|
|
|
|
|
|
|
- name: Checkout
|
2022-11-27 11:36:57 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-01-10 17:26:36 +00:00
|
|
|
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
|
|
|
|
env:
|
|
|
|
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
|
|
|
|
run: |
|
|
|
|
python3 intl/download_workflow.py $CROWDIN_API_KEY "beetle-pce-fast-libretro" "libretro_core_options_intl.h"
|
|
|
|
|
|
|
|
- name: Commit files
|
|
|
|
run: |
|
|
|
|
git config --local user.email "github-actions@github.com"
|
|
|
|
git config --local user.name "github-actions[bot]"
|
|
|
|
git add intl/*_workflow.py "libretro_core_options_intl.h"
|
|
|
|
git commit -m "Fetch translations & Recreate libretro_core_options_intl.h"
|
|
|
|
|
|
|
|
- name: GitHub Push
|
|
|
|
uses: ad-m/github-push-action@v0.6.0
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
branch: ${{ github.ref }}
|