First attempt automated crowdin (#3521)

This commit is contained in:
Kowlin 2020-02-08 04:44:41 +01:00 committed by GitHub
parent 17b8ef09c6
commit c6bc4c1bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 8 deletions

View File

@ -1,8 +1,13 @@
name: Publish to Crowdin name: Publish to Crowdin
on: on:
push: schedule:
tags: - cron: '0 12 * * THU'
- "*" repository_dispatch:
types: crowdin
env:
CROWDIN_API_KEY: ${{ secrets.crowdin_token}}
CROWDIN_PROJECT_ID: ${{ secrets.crowdin_identifier }}
jobs: jobs:
deploy: deploy:
@ -20,9 +25,24 @@ jobs:
sudo apt-get update -qq sudo apt-get update -qq
sudo apt-get install -y crowdin sudo apt-get install -y crowdin
pip install redgettext==3.1 pip install redgettext==3.1
- name: Publish - name: Generate source files
env: run: |
CROWDIN_API_KEY: ${{ secrets.crowdin_token}} make gettext
CROWDIN_PROJECT_ID: ${{ secrets.crowdin_identifier }} - name: Upload source files
run: | run: |
make upload_translations make upload_translations
- name: Download translations
run: |
make download_translations
- name: Create Pull Request
uses: peter-evans/create-pull-request@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Automated Crowdin downstream
title: "[i18n] Automated Crowdin downstream"
body: |
This is an automated PR.
Please ensure that there are no errors or invalid files are in the PR.
labels: "Automated PR, Category: i18n"
branch: "automated/i18n"

View File

@ -10,7 +10,6 @@ stylecheck:
gettext: gettext:
$(PYTHON) -m redgettext --command-docstrings --verbose --recursive redbot --exclude-files "redbot/pytest/**/*" $(PYTHON) -m redgettext --command-docstrings --verbose --recursive redbot --exclude-files "redbot/pytest/**/*"
upload_translations: upload_translations:
$(MAKE) gettext
crowdin upload sources crowdin upload sources
download_translations: download_translations:
crowdin download crowdin download