mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
51 lines
1.6 KiB
YAML
51 lines
1.6 KiB
YAML
# GitHub Action to extract translations and (later) upload them to Crowdin.
|
|
|
|
name: Extract translations
|
|
on:
|
|
# Execute for all commits (to ensure translations extraction works)
|
|
push:
|
|
# Allows to run this workflow manually from the Actions tab.
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
extract-translations:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
- uses: actions/checkout@v2
|
|
|
|
# Cache npm dependencies to speed up the workflow
|
|
- name: Cache node modules
|
|
uses: actions/cache@v2
|
|
env:
|
|
cache-name: cache-newIDE-app-node_modules
|
|
with:
|
|
# npm cache files are stored in `~/.npm` on Linux/macOS
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('newIDE/app/package-lock.json') }}
|
|
|
|
- name: Install gettext
|
|
run: sudo apt update && sudo apt install gettext -y
|
|
|
|
- name: Install newIDE dependencies
|
|
run: npm install
|
|
working-directory: newIDE/app
|
|
|
|
- name: Extract translations
|
|
run: npm run extract-all-translations
|
|
working-directory: newIDE/app
|
|
|
|
# Only upload on Crowdin for the master branch
|
|
- name: Install Crowdin CLI
|
|
if: github.ref == 'refs/heads/master'
|
|
run: npm i -g @crowdin/cli
|
|
|
|
- name: Upload translations to Crowdin
|
|
run: crowdin upload sources
|
|
if: github.ref == 'refs/heads/master'
|
|
env:
|
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|