From c6bc4c1bd640dec1f61bfa4c2f37e9ade737a9cc Mon Sep 17 00:00:00 2001 From: Kowlin Date: Sat, 8 Feb 2020 04:44:41 +0100 Subject: [PATCH] First attempt automated crowdin (#3521) --- .github/workflows/publish_crowdin.yml | 34 +++++++++++++++++++++------ Makefile | 1 - 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish_crowdin.yml b/.github/workflows/publish_crowdin.yml index f4a8f8519..ec3294f0f 100644 --- a/.github/workflows/publish_crowdin.yml +++ b/.github/workflows/publish_crowdin.yml @@ -1,8 +1,13 @@ name: Publish to Crowdin on: - push: - tags: - - "*" + schedule: + - cron: '0 12 * * THU' + repository_dispatch: + types: crowdin + +env: + CROWDIN_API_KEY: ${{ secrets.crowdin_token}} + CROWDIN_PROJECT_ID: ${{ secrets.crowdin_identifier }} jobs: deploy: @@ -20,9 +25,24 @@ jobs: sudo apt-get update -qq sudo apt-get install -y crowdin pip install redgettext==3.1 - - name: Publish - env: - CROWDIN_API_KEY: ${{ secrets.crowdin_token}} - CROWDIN_PROJECT_ID: ${{ secrets.crowdin_identifier }} + - name: Generate source files + run: | + make gettext + - name: Upload source files run: | 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" + diff --git a/Makefile b/Makefile index cd9fb278a..2d9d24366 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,6 @@ stylecheck: gettext: $(PYTHON) -m redgettext --command-docstrings --verbose --recursive redbot --exclude-files "redbot/pytest/**/*" upload_translations: - $(MAKE) gettext crowdin upload sources download_translations: crowdin download