From 4a3db4fea7aa848f290c1d810b45800027b5ec09 Mon Sep 17 00:00:00 2001 From: Patrick Honkonen <1883101+SaintPatrck@users.noreply.github.com> Date: Wed, 30 Jul 2025 14:03:13 -0400 Subject: [PATCH] [PM-24175] Refactor Crowdin workflow (#5587) --- .github/workflows/crowdin-pull.yml | 27 ++++++++------------------- .github/workflows/crowdin-push.yml | 15 ++------------- crowdin-bwa.yml | 9 --------- crowdin-bwpm.yml => crowdin.yml | 5 ----- 4 files changed, 10 insertions(+), 46 deletions(-) delete mode 100644 crowdin-bwa.yml rename crowdin-bwpm.yml => crowdin.yml (59%) diff --git a/.github/workflows/crowdin-pull.yml b/.github/workflows/crowdin-pull.yml index 5f42757cb4..f79d2f3f49 100644 --- a/.github/workflows/crowdin-pull.yml +++ b/.github/workflows/crowdin-pull.yml @@ -8,23 +8,12 @@ on: jobs: crowdin-sync: - name: Crowdin Pull - ${{ matrix.name }} - ${{ github.event_name }} + name: Crowdin Pull - ${{ github.event_name }} runs-on: ubuntu-24.04 permissions: contents: write pull-requests: write id-token: write - strategy: - matrix: - include: - - name: Password Manager - project_id: 269690 - config: crowdin-bwpm.yml - branch: crowdin-pull-bwpm - - name: Authenticator - project_id: 673718 - config: crowdin-bwa.yml - branch: crowdin-pull-bwa steps: - name: Checkout repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -60,23 +49,23 @@ jobs: app-id: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-ID }} private-key: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-KEY }} - - name: Download translations for ${{ matrix.name }} + - name: Download translations uses: crowdin/github-action@b8012bd5491b8aa8578b73ab5b5f5e7c94aaa6e2 # v2.7.0 env: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }} - _CROWDIN_PROJECT_ID: ${{ matrix.project_id }} + _CROWDIN_PROJECT_ID: "269690" with: - config: ${{ matrix.config }} + config: crowdin.yml upload_sources: false upload_translations: false download_translations: true github_user_name: "bitwarden-devops-bot" github_user_email: "106330231+bitwarden-devops-bot@users.noreply.github.com" - commit_message: "Crowdin Pull - ${{ matrix.name }}" - localization_branch_name: ${{ matrix.branch }} + commit_message: "Crowdin Pull" + localization_branch_name: "crowdin-pull" create_pull_request: true - pull_request_title: "Crowdin Pull - ${{ matrix.name }}" - pull_request_body: ":inbox_tray: New translations for ${{ matrix.name }} received!" + pull_request_title: "Crowdin Pull" + pull_request_body: ":inbox_tray: New translations received!" gpg_private_key: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key }} gpg_passphrase: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key-passphrase }} diff --git a/.github/workflows/crowdin-push.yml b/.github/workflows/crowdin-push.yml index 3a9c59ac0e..a77b6f0fe7 100644 --- a/.github/workflows/crowdin-push.yml +++ b/.github/workflows/crowdin-push.yml @@ -32,27 +32,16 @@ jobs: keyvault: "bitwarden-ci" secrets: "crowdin-api-token" - - name: Upload sources for Password Manager + - name: Upload sources uses: crowdin/github-action@b8012bd5491b8aa8578b73ab5b5f5e7c94aaa6e2 # v2.7.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }} _CROWDIN_PROJECT_ID: "269690" with: - config: crowdin-bwpm.yml + config: crowdin.yml upload_sources: true upload_translations: false - name: Log out from Azure uses: bitwarden/gh-actions/azure-logout@main - - - name: Upload sources for Authenticator - uses: crowdin/github-action@b8012bd5491b8aa8578b73ab5b5f5e7c94aaa6e2 # v2.7.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }} - _CROWDIN_PROJECT_ID: "673718" - with: - config: crowdin-bwa.yml - upload_sources: true - upload_translations: false diff --git a/crowdin-bwa.yml b/crowdin-bwa.yml deleted file mode 100644 index 599ba87b84..0000000000 --- a/crowdin-bwa.yml +++ /dev/null @@ -1,9 +0,0 @@ -project_id_env: _CROWDIN_PROJECT_ID -api_token_env: CROWDIN_API_TOKEN -preserve_hierarchy: true -base_path: "authenticator/src/main" -files: - - source: "/res/values/strings.xml" - translation: "/res/values-%android_code%/%original_file_name%" - update_option: update_as_unapproved - type: android diff --git a/crowdin-bwpm.yml b/crowdin.yml similarity index 59% rename from crowdin-bwpm.yml rename to crowdin.yml index 8c33726e27..916e946dd1 100644 --- a/crowdin-bwpm.yml +++ b/crowdin.yml @@ -2,11 +2,6 @@ project_id_env: _CROWDIN_PROJECT_ID api_token_env: CROWDIN_API_TOKEN preserve_hierarchy: true files: - - source: "/app/src/main/res/values/strings.xml" - translation: "/app/src/main/res/values-%android_code%/%original_file_name%" - dest: "/android/%original_file_name%" - update_option: update_as_unapproved - type: android - source: "/ui/src/main/res/values/strings.xml" translation: "/ui/src/main/res/values-%android_code%/%original_file_name%" dest: "/android-ui/%original_file_name%"