Skip to content

Commit 0762dfd

Browse files
committed
feat: traktify
1 parent fefbd64 commit 0762dfd

2 files changed

Lines changed: 138 additions & 88 deletions

File tree

.github/workflows/ci_cd_test.yml

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,65 @@ jobs:
4848
- '.github/workflows/**'
4949
- '.github/actions/**'
5050
51-
test:
51+
localize:
5252
needs: files-changed
53-
if: ${{
54-
needs.files-changed.outputs.i18n_source != 'true' &&
55-
(needs.files-changed.outputs.client_source == 'true' ||
56-
needs.files-changed.outputs.workflows == 'true')
57-
}}
53+
if: ${{ needs.files-changed.outputs.i18n_source == 'true' }}
54+
name: The Translation Pit (Localize)
55+
runs-on: ubuntu-latest
56+
concurrency:
57+
group: ci-${{ github.ref }}
58+
cancel-in-progress: true
59+
steps:
60+
- name: Summoning the GitHub App Token
61+
uses: actions/create-github-app-token@v2
62+
id: generate-token
63+
with:
64+
app-id: ${{ secrets.GH_APP_ID }}
65+
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
66+
permission-contents: write
67+
68+
- name: Checkout
69+
uses: actions/checkout@v4
70+
71+
- name: Upload Sources to Crowdin
72+
uses: crowdin/github-action@v2
73+
with:
74+
upload_sources: true
75+
env:
76+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
77+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
78+
79+
- name: Pre-Translate
80+
uses: crowdin/github-action@v2
81+
with:
82+
command: 'pre-translate'
83+
command_args: '--method ai --ai-prompt=${{ secrets.CROWDIN_AI_PROMPT_ID }}'
84+
env:
85+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
86+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
87+
88+
- name: Download Bundles
89+
uses: crowdin/github-action@v2
90+
with:
91+
upload_sources: false
92+
upload_translations: false
93+
download_translations: false
94+
download_bundle: 6
95+
skip_untranslated_strings: true
96+
create_pull_request: false
97+
localization_branch_name: feat/crowdin
98+
commit_message: 'feat(i18n): update translations'
99+
env:
100+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
101+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
102+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
103+
104+
test:
105+
needs: localize
106+
if: ${{ always() &&
107+
(needs.files-changed.outputs.client_source == 'true' ||
108+
needs.files-changed.outputs.workflows == 'true'))
109+
}}
58110
name: The Interrogation Room (Test)
59111
runs-on: ubuntu-latest
60112
concurrency:

.github/workflows/i18n-crowdin.yml

Lines changed: 80 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,82 @@
11
name: CrowdIn Flow
22

3-
on:
4-
push:
5-
branches:
6-
- feat/crowdin
7-
paths:
8-
- 'projects/client/i18n/meta/**'
9-
10-
jobs:
11-
files-changed:
12-
name: The Scrutiny of Change
13-
runs-on: ubuntu-latest
14-
concurrency:
15-
group: i18n-${{ github.ref }}
16-
cancel-in-progress: true
17-
outputs:
18-
i18n_source: ${{ steps.changes.outputs.i18n_source }}
19-
steps:
20-
- name: Unveiling the Repository
21-
uses: actions/checkout@v4
22-
23-
- name: The Chronicle of Alterations
24-
uses: dorny/paths-filter@v3
25-
id: changes
26-
with:
27-
filters: |
28-
i18n_source:
29-
- 'projects/client/i18n/meta/**'
30-
31-
crowdin:
32-
needs: files-changed
33-
if: ${{ needs.files-changed.outputs.i18n_source == 'true' }}
34-
name: The Translation Room (CrowdIn)
35-
runs-on: ubuntu-latest
36-
concurrency:
37-
group: i18n-${{ github.ref }}
38-
cancel-in-progress: true
39-
steps:
40-
- name: Summoning the GitHub App Token
41-
uses: actions/create-github-app-token@v2
42-
id: generate-token
43-
with:
44-
app-id: ${{ secrets.GH_APP_ID }}
45-
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
46-
permission-contents: write
47-
48-
- name: Checkout
49-
uses: actions/checkout@v4
50-
with:
51-
token: ${{ steps.generate-token.outputs.token }}
52-
53-
- name: Upload Sources to Crowdin
54-
uses: crowdin/github-action@v2
55-
with:
56-
upload_sources: true
57-
env:
58-
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
59-
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
60-
61-
- name: Pre-Translate
62-
uses: crowdin/github-action@v2
63-
with:
64-
command: 'pre-translate'
65-
command_args: '--method ai --ai-prompt=${{ secrets.CROWDIN_AI_PROMPT_ID }}'
66-
env:
67-
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
68-
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
69-
70-
- name: Download Bundles
71-
uses: crowdin/github-action@v2
72-
with:
73-
upload_sources: false
74-
upload_translations: false
75-
download_translations: false
76-
download_bundle: 6
77-
skip_untranslated_strings: true
78-
create_pull_request: false
79-
localization_branch_name: feat/crowdin
80-
commit_message: 'feat(i18n): update translations'
81-
env:
82-
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
83-
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
84-
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
3+
#on:
4+
# push:
5+
# branches:
6+
# - feat/crowdin
7+
# paths:
8+
# - 'projects/client/i18n/meta/**'
9+
#
10+
#jobs:
11+
# files-changed:
12+
# name: The Scrutiny of Change
13+
# runs-on: ubuntu-latest
14+
# concurrency:
15+
# group: i18n-${{ github.ref }}
16+
# cancel-in-progress: true
17+
# outputs:
18+
# i18n_source: ${{ steps.changes.outputs.i18n_source }}
19+
# steps:
20+
# - name: Unveiling the Repository
21+
# uses: actions/checkout@v4
22+
#
23+
# - name: The Chronicle of Alterations
24+
# uses: dorny/paths-filter@v3
25+
# id: changes
26+
# with:
27+
# filters: |
28+
# i18n_source:
29+
# - 'projects/client/i18n/meta/**'
30+
#
31+
# crowdin:
32+
# needs: files-changed
33+
# if: ${{ needs.files-changed.outputs.i18n_source == 'true' }}
34+
# name: The Translation Room (CrowdIn)
35+
# runs-on: ubuntu-latest
36+
# concurrency:
37+
# group: i18n-${{ github.ref }}
38+
# cancel-in-progress: true
39+
# steps:
40+
# - name: Summoning the GitHub App Token
41+
# uses: actions/create-github-app-token@v2
42+
# id: generate-token
43+
# with:
44+
# app-id: ${{ secrets.GH_APP_ID }}
45+
# private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
46+
# permission-contents: write
47+
#
48+
# - name: Checkout
49+
# uses: actions/checkout@v4
50+
#
51+
# - name: Upload Sources to Crowdin
52+
# uses: crowdin/github-action@v2
53+
# with:
54+
# upload_sources: true
55+
# env:
56+
# CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
57+
# CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
58+
#
59+
# - name: Pre-Translate
60+
# uses: crowdin/github-action@v2
61+
# with:
62+
# command: 'pre-translate'
63+
# command_args: '--method ai --ai-prompt=${{ secrets.CROWDIN_AI_PROMPT_ID }}'
64+
# env:
65+
# CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
66+
# CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
67+
#
68+
# - name: Download Bundles
69+
# uses: crowdin/github-action@v2
70+
# with:
71+
# upload_sources: false
72+
# upload_translations: false
73+
# download_translations: false
74+
# download_bundle: 6
75+
# skip_untranslated_strings: true
76+
# create_pull_request: false
77+
# localization_branch_name: feat/crowdin
78+
# commit_message: 'feat(i18n): update translations'
79+
# env:
80+
# GH_TOKEN: ${{ steps.generate-token.outputs.token }}
81+
# CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
82+
# CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

0 commit comments

Comments
 (0)