Skip to content

Commit 0f13c8f

Browse files
committed
Add GHA workflow to build OTA updates
1 parent f6244f2 commit 0f13c8f

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: OTA translations
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# Every day at 10:11 UTC
7+
- cron: '11 10 * * *'
8+
9+
jobs:
10+
build-ota-translations:
11+
name: Build OTA translations
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Install GNU gettext
18+
run: sudo apt-get install gettext
19+
20+
- name: Install Crowdin CLI
21+
run: npm i -g @crowdin/cli
22+
23+
- name: Download latest translations from Crowdin
24+
run: |
25+
echo 'api_token: "${{secrets.CROWDIN_PERSONAL_TOKEN}}"' >>crowdin.yaml
26+
crowdin download
27+
rm crowdin.yaml
28+
29+
- name: Build OTA updates
30+
run: scripts/build-ota-translations.sh
31+
32+
- name: Upload OTA updates
33+
run: |
34+
VERSION=$(sed -n -e 's/.*POEDIT_VERSION.* "\([0-9]*\)\.\([0-9]*\).*".*/\1.\2/p' src/version.h)
35+
echo "OTA version: $VERSION"
36+
curl --fail-with-body -F 'data=@ota-update.tar' -H "X-Api-Key: ${{secrets.OTA_API_KEY}}" "${{secrets.OTA_UPLOAD_ENDPOINT}}?version=${VERSION}"

0 commit comments

Comments
 (0)