From 0bb584445ba09137ce63117f66f63438668fd6d3 Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Sat, 3 May 2025 13:35:28 -0500 Subject: [PATCH] Refactor: Split Crowdin Action into Upload and Download Workflows (#1815) --- .../{crowdin.yml => crowdin-download.yml} | 15 ++++------ .github/workflows/crowdin-upload.yml | 28 +++++++++++++++++++ 2 files changed, 33 insertions(+), 10 deletions(-) rename .github/workflows/{crowdin.yml => crowdin-download.yml} (72%) create mode 100644 .github/workflows/crowdin-upload.yml diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin-download.yml similarity index 72% rename from .github/workflows/crowdin.yml rename to .github/workflows/crowdin-download.yml index 3c9c377ef..1f7e41e6c 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin-download.yml @@ -1,8 +1,8 @@ -name: Crowdin Action +name: Crowdin Download Translations Action on: - push: - branches: [ master ] + schedule: # Every Sunday at midnight + - cron: '0 0 * * 0' workflow_dispatch: # Allow manual triggering jobs: @@ -13,12 +13,12 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Synchronize with Crowdin + - name: Download translations with Crowdin uses: crowdin/github-action@v2 with: base_url: 'https://meshtastic.crowdin.com/api/v2' config: 'config/crowdin/crowdin.yml' - upload_sources: true + upload_sources: false upload_translations: false download_translations: true localization_branch_name: l10n_crowdin_translations @@ -30,11 +30,6 @@ jobs: pull_request_labels: 'l10n' crowdin_branch_name: 'master' env: - # A classic GitHub Personal Access Token with the 'repo' scope selected (the user should have write access to the repository). GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # A numeric ID, found at https://crowdin.com/project//tools/api CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} - - # Visit https://crowdin.com/settings#api-key to create this token CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} diff --git a/.github/workflows/crowdin-upload.yml b/.github/workflows/crowdin-upload.yml new file mode 100644 index 000000000..95ef4fb62 --- /dev/null +++ b/.github/workflows/crowdin-upload.yml @@ -0,0 +1,28 @@ +name: Crowdin Upload Sources Action + +on: + push: # Watch source strings.xml for changes on master + paths: [ 'app/src/main/res/values/strings.xml' ] + branches: [ master ] + workflow_dispatch: # Allow manual triggering + +jobs: + synchronize-with-crowdin: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Upload sources with Crowdin + uses: crowdin/github-action@v2 + with: + base_url: 'https://meshtastic.crowdin.com/api/v2' + config: 'config/crowdin/crowdin.yml' + upload_sources: true + upload_translations: false + download_translations: false + crowdin_branch_name: 'master' + env: + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}