-
Notifications
You must be signed in to change notification settings - Fork 46
76 lines (72 loc) · 2.63 KB
/
l10n_extract.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Extract Strings
on:
schedule:
- cron: '0 20 * * 1,4' # At 13:00 PDT on Mondays, Thursdays
workflow_dispatch:
jobs:
extract:
runs-on: ubuntu-latest
steps:
- name: Install Linux packages
run: |
sudo apt update
sudo apt install gettext -y
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install global npm packages
run: |
npm install -g grunt-cli
- name: Clone l10n repository
uses: actions/checkout@v4
with:
path: "fxa-l10n"
- name: Clone FxA code repository
uses: actions/checkout@v4
with:
repository: "mozilla/fxa"
fetch-depth: 1
path: "fxa-code"
- name: Install npm packages
run: |
cd fxa-l10n
npm install
- name: Extract strings
run: |
cd fxa-code
_scripts/l10n/clone.sh
yarn workspaces focus fxa-content-server fxa-auth-server fxa-payments-server fxa-settings
yarn workspace fxa-payments-server grunt merge-ftl
yarn workspace fxa-settings grunt merge-ftl
yarn workspace fxa-auth-server grunt merge-ftl
yarn workspace fxa-react grunt merge-ftl
NODE_ENV=development ../fxa-l10n/scripts/extract_strings.sh \
--mailer-repo ./packages/fxa-auth-server \
--payments-repo ./packages/fxa-payments-server \
--content-repo ./packages/fxa-content-server \
--settings-repo ./packages/fxa-settings \
--react-repo ./packages/fxa-react \
--shared-repo ./libs/shared \
--l10n-repo ../fxa-l10n
- name: Commit changes and open pull request
run: |
# Only try to commit if there are pending changes
cd fxa-l10n
if [[ $(git diff --exit-code) || $(git ls-files --other --exclude-standard) ]]
then
git config --global user.email '[email protected]'
git config --global user.name 'Bug Mirror'
# Random release number to avoid collision with old trains or branches
TRAIN_NUMBER=$(( $RANDOM + $RANDOM + 1000 ))
git checkout -B "merge-train-$TRAIN_NUMBER-strings"
git add .
git commit -m "Merge strings for train $TRAIN_NUMBER"
git push -f origin "merge-train-$TRAIN_NUMBER-strings"
# Create pull request, use the last commit message as title
gh pr create --fill
else
echo "No changes found."
fi
env:
GITHUB_TOKEN: ${{ secrets.FXA_GITHUB_TOKEN }}