Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

feat: use crowdin branches #1790

Closed
wants to merge 19 commits into from
Closed
27 changes: 27 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
###############################################
# THIS FILE IS AUTOMATICALLY GENERATED FROM #
# lib/generators/templates/auto-merge.yml.tpl #
###############################################

on:
schedule:
- cron: 00 09 * * *
workflow_dispatch: {}

name: Auto-merge Crowdin PRs

jobs:
auto-merge:
name: Install dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install dependencies
run: npm ci
- name: Automerge PR
env:
GH_TOKEN: $
run: npm run automerge
105 changes: 105 additions & 0 deletions .github/workflows/download-content.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#################################################
# THIS FILE IS AUTOMATICALLY GENERATED FROM #
# lib/generators/templates/gha-download.yml.tpl #
#################################################

on:
schedule:
- cron: 0 */1 * * *
workflow_dispatch: {}

name: Fetch translated content

jobs:
content-10-x-y:
name: Fetch latest translated content (10-x-y)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
with:
ref: content/10-x-y
- run: |
git fetch
- name: Download content from Crowdin
uses: crowdin/[email protected]
with:
upload_sources: false
download_translations: true
localization_branch_name: translated/10-x-y
crowdin_branch_name: 10-x-y
pull_request_title: 'feat: new Crowdin translations (10-x-y)'
commit_message: 'feat: new Crowdin translation (10-x-y)'
config: crowdin.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
content-11-x-y:
name: Fetch latest translated content (11-x-y)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
with:
ref: content/11-x-y
- run: |
git fetch
- name: Download content from Crowdin
uses: crowdin/[email protected]
with:
upload_sources: false
download_translations: true
localization_branch_name: translated/11-x-y
crowdin_branch_name: 11-x-y
pull_request_title: 'feat: new Crowdin translations (11-x-y)'
commit_message: 'feat: new Crowdin translation (11-x-y)'
config: crowdin.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
content-13-x-y:
name: Fetch latest translated content (13-x-y)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
with:
ref: content/13-x-y
- run: |
git fetch
- name: Download content from Crowdin
uses: crowdin/[email protected]
with:
upload_sources: false
download_translations: true
localization_branch_name: translated/13-x-y
crowdin_branch_name: 13-x-y
pull_request_title: 'feat: new Crowdin translations (13-x-y)'
commit_message: 'feat: new Crowdin translation (13-x-y)'
config: crowdin.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
content-current:
name: Fetch latest translated content (current)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
with:
ref: content/current
- run: |
git fetch
- name: Download content from Crowdin
uses: crowdin/[email protected]
with:
upload_sources: false
download_translations: true
localization_branch_name: translated/current
crowdin_branch_name: current
pull_request_title: 'feat: new Crowdin translations (current)'
commit_message: 'feat: new Crowdin translation (current)'
config: crowdin.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
29 changes: 0 additions & 29 deletions .github/workflows/schedule-download-translations.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/schedule-update-source-content.yml

This file was deleted.

129 changes: 129 additions & 0 deletions .github/workflows/update-content.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
###############################################
# THIS FILE IS AUTOMATICALLY GENERATED FROM #
# lib/generators/templates/gha-update.yml.tpl #
###############################################

on:
schedule:
- cron: 0 */6 * * *
workflow_dispatch: {}

name: Update source content

jobs:
fetchSourceContent:
name: Fetch latest source content
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Fetch latest source content
run: |
git config --global user.email [email protected]
git config --global user.name electron-bot

npm ci
npm run collect
npm run content-cleanup

if [ "$(git status --porcelain)" = "" ]; then
echo "no new content found; goodbye!"
exit
else
echo "found some new content! committing changes to git"
fi

# `pretest` script will run the build first
npm test

git add .
git commit -am "feat: update source content"
git pull --rebase && git push origin master --follow-tags
env:
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NODE_OPTIONS: --max_old_space_size=4096

upload-10-x-y:
name: Upload source content (10-x-y)
runs-on: ubuntu-20.04
needs:
- fetchSourceContent

steps:
- uses: actions/checkout@master
with:
ref: content/10-x-y
- name: Upload Content To Crowdin (10-x-y)
uses: crowdin/[email protected]
with:
upload_sources: true
crowdin_branch_name: 10-x-y
config: crowdin.yml
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
upload-11-x-y:
name: Upload source content (11-x-y)
runs-on: ubuntu-20.04
needs:
- fetchSourceContent

steps:
- uses: actions/checkout@master
with:
ref: content/11-x-y
- name: Upload Content To Crowdin (11-x-y)
uses: crowdin/[email protected]
with:
upload_sources: true
crowdin_branch_name: 11-x-y
config: crowdin.yml
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
upload-13-x-y:
name: Upload source content (13-x-y)
runs-on: ubuntu-20.04
needs:
- fetchSourceContent

steps:
- uses: actions/checkout@master
with:
ref: content/13-x-y
- name: Upload Content To Crowdin (13-x-y)
uses: crowdin/[email protected]
with:
upload_sources: true
crowdin_branch_name: 13-x-y
config: crowdin.yml
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
upload-current:
name: Upload source content (current)
runs-on: ubuntu-20.04
needs:
- fetchSourceContent

steps:
- uses: actions/checkout@master
with:
ref: content/current
- name: Upload Content To Crowdin (current)
uses: crowdin/[email protected]
with:
upload_sources: true
crowdin_branch_name: current
config: crowdin.yml
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
58 changes: 0 additions & 58 deletions crowdin.yml

This file was deleted.

Loading