-
Notifications
You must be signed in to change notification settings - Fork 140
70 lines (59 loc) · 2.64 KB
/
pull-transifex.yml
File metadata and controls
70 lines (59 loc) · 2.64 KB
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
name: "Pull translations from Transifex"
on:
workflow_dispatch:
schedule:
- cron: "0 3 * * *"
permissions: {}
jobs:
pull-translations:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: "master"
persist-credentials: false
- name: l10n-pull
uses: transifex/cli-action@584fd205cbe598773b5a81ce711fa44842678189 # v2
with:
token: ${{ secrets.TX_TOKEN }}
args: pull --force --skip --all
- name: l10n-format
shell: bash
run: |
beautifyJSON() {
jq --sort-keys 'walk(if type == "object" then del(."th_TH", ."pt_PT", ."pt_BR", ."nn_NO", ."nb_NO", ."en_GB") else . end)' "$1" >"$1.tmp"
mv "$1.tmp" "$1"
}
beautifyJSON "ownCloud Action Extension/InfoPlist.xcstrings"
beautifyJSON "ownCloud File Provider/Localizable.xcstrings"
beautifyJSON "ownCloud Share Extension/InfoPlist.xcstrings"
beautifyJSON "ownCloud/Resources/InfoPlist.xcstrings"
beautifyJSON "ownCloud/Resources/Localizable.xcstrings"
beautifyJSON "ownCloudAppFramework/Resources/Localizable.xcstrings"
- name: Setup Swift
uses: swift-actions/setup-swift@7ca6abe6b3b0e8b5421b88be48feee39cbf52c6a # v2.4.0
- name: Build ocstringstool
run: |
swift -v
swiftc tools/normalizestrings/main.swift -o /tmp/ocstringstool
- name: Run ocstringstool
run: /tmp/ocstringstool normalize "ownCloud/Resources" "ownCloud Action Extension" "ownCloud File Provider" "ownCloud Share Extension" "ownCloudAppFramework/Resources"
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6
with:
app-id: ${{ secrets.TRANSLATION_APP_ID }}
private-key: ${{ secrets.TRANSLATION_APP_PRIVATE_KEY }}
- name: Create or update translations PR
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
token: ${{ steps.app-token.outputs.token }}
branch: chore/translations-update
base: master
commit-message: "chore: update translations from transifex"
title: "chore: update translations from transifex"
body: "Automated translation update from Transifex. This pull request is updated on each sync run — merging it will close it and a fresh one will be opened on the next change."
delete-branch: true
sign-commits: true