Skip to content

Commit d5cf218

Browse files
authored
[PM-18435] CI restructuring #5 - Consolidate Crowdin pull and push workflows (#1566)
1 parent 2881e2b commit d5cf218

File tree

5 files changed

+42
-108
lines changed

5 files changed

+42
-108
lines changed

.github/workflows/build-bwa.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -188,25 +188,3 @@ jobs:
188188
--file "build/Authenticator/Authenticator.ipa" \
189189
--apiKey "J46C83CB96" \
190190
--apiIssuer "${{ secrets.APP_STORE_CONNECT_TEAM_ISSUER }}"
191-
192-
crowdin-push:
193-
name: Crowdin Push
194-
if: github.ref == 'refs/heads/main'
195-
needs:
196-
- build
197-
runs-on: ubuntu-22.04
198-
env:
199-
_CROWDIN_PROJECT_ID: "673718"
200-
steps:
201-
- name: Check out repo
202-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
203-
204-
- name: Upload sources
205-
uses: crowdin/github-action@b8012bd5491b8aa8578b73ab5b5f5e7c94aaa6e2 # v2.7.0
206-
env:
207-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
208-
CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
209-
with:
210-
config: crowdin-bwa.yml
211-
upload_sources: true
212-
upload_translations: false

.github/workflows/crowdin-pull-bwa.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/crowdin-pull.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
1-
name: Crowdin Sync
1+
name: Cron / Crowdin Pull
2+
run-name: Crowdin Pull - ${{ github.event_name == 'workflow_dispatch' && 'Manual' || 'Scheduled' }}
23

34
on:
45
workflow_dispatch:
5-
inputs: {}
66
schedule:
77
- cron: '0 0 * * 5'
88

99
jobs:
1010
crowdin-sync:
11-
name: Autosync
11+
name: Crowdin Pull - ${{ matrix.name }} - ${{ github.event_name }}
1212
runs-on: ubuntu-24.04
13-
env:
14-
_CROWDIN_PROJECT_ID: "269690"
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
strategy:
17+
matrix:
18+
include:
19+
- name: Password Manager
20+
project_id: 269690
21+
config: crowdin-pm.yml
22+
branch: crowdin-pull-bwpm
23+
- name: Authenticator
24+
project_id: 673718
25+
config: crowdin-bwa.yml
26+
branch: crowdin-pull-bwa
1527
steps:
1628
- name: Checkout repo
1729
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -35,22 +47,23 @@ jobs:
3547
app-id: ${{ secrets.BW_GHAPP_ID }}
3648
private-key: ${{ secrets.BW_GHAPP_KEY }}
3749

38-
- name: Download translations
50+
- name: Download translations for ${{ matrix.name }}
3951
uses: crowdin/github-action@b8012bd5491b8aa8578b73ab5b5f5e7c94aaa6e2 # v2.7.0
4052
env:
4153
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
4254
CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }}
55+
_CROWDIN_PROJECT_ID: ${{ matrix.project_id }}
4356
with:
44-
config: crowdin-pm.yml
57+
config: ${{ matrix.config }}
4558
upload_sources: false
4659
upload_translations: false
4760
download_translations: true
4861
github_user_name: "bitwarden-devops-bot"
4962
github_user_email: "106330231+bitwarden-devops-bot@users.noreply.github.com"
50-
commit_message: "Autosync the updated translations"
51-
localization_branch_name: crowdin-auto-sync
63+
commit_message: "Crowdin Pull - ${{ matrix.name }}"
64+
localization_branch_name: ${{ matrix.branch }}
5265
create_pull_request: true
53-
pull_request_title: "Autosync Crowdin Translations"
54-
pull_request_body: "Autosync the updated translations"
66+
pull_request_title: "Crowdin Pull - ${{ matrix.name }}"
67+
pull_request_body: ":inbox_tray: New translations for ${{ matrix.name }} received!"
5568
gpg_private_key: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key }}
5669
gpg_passphrase: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key-passphrase }}

.github/workflows/crowdin-push-bwa.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/crowdin-push.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Crowdin Push
1+
name: CI / Crowdin Push
2+
run-name: Crowdin Push - ${{ github.event_name == 'workflow_dispatch' && 'Manual' || 'CI' }}
23

34
on:
45
workflow_dispatch:
@@ -8,10 +9,10 @@ on:
89

910
jobs:
1011
crowdin-push:
11-
name: Crowdin Push
12+
name: Crowdin Push - ${{ github.event_name }}
1213
runs-on: ubuntu-24.04
13-
env:
14-
_CROWDIN_PROJECT_ID: "269690"
14+
permissions:
15+
contents: read
1516
steps:
1617
- name: Check out repo
1718
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -28,12 +29,24 @@ jobs:
2829
keyvault: "bitwarden-ci"
2930
secrets: "crowdin-api-token"
3031

31-
- name: Upload sources
32+
- name: Upload sources for Password Manager
3233
uses: crowdin/github-action@b8012bd5491b8aa8578b73ab5b5f5e7c94aaa6e2 # v2.7.0
3334
env:
3435
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3536
CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }}
37+
_CROWDIN_PROJECT_ID: "269690"
3638
with:
3739
config: crowdin-pm.yml
3840
upload_sources: true
3941
upload_translations: false
42+
43+
- name: Upload sources for Authenticator
44+
uses: crowdin/github-action@b8012bd5491b8aa8578b73ab5b5f5e7c94aaa6e2 # v2.7.0
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }}
48+
_CROWDIN_PROJECT_ID: "673718"
49+
with:
50+
config: crowdin-bwa.yml
51+
upload_sources: true
52+
upload_translations: false

0 commit comments

Comments
 (0)