Skip to content

Commit

Permalink
Add GHA workflow to build OTA updates
Browse files Browse the repository at this point in the history
  • Loading branch information
vslavik committed Nov 1, 2023
1 parent f6244f2 commit 27fdc00
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build-ota-updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: OTA translations

on:
push:
workflow_dispatch:
schedule:
# Every day at 10:11 UTC
- cron: '11 10 * * *'

jobs:
build-ota-translations:
name: Build OTA translations
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install GNU gettext
run: sudo apt-get install gettext

- name: Install Crowdin CLI
run: npm i -g @crowdin/cli

- name: Download latest translations from Crowdin
run: |
echo 'api_token: "${{secrets.CROWDIN_PERSONAL_TOKEN}}"' >>crowdin.yaml
crowdin download
rm crowdin.yaml
- name: Build OTA updates
run: scripts/build-ota-translations.sh

- name: Upload OTA updates
run: |
VERSION=$(sed -n -e 's/.*POEDIT_VERSION.* "\([0-9]*\)\.\([0-9]*\).*".*/\1.\2/p' src/version.h)
echo "OTA version: $VERSION"
curl --fail-with-body -F '[email protected]' -H "X-Api-Key: ${{secrets.OTA_API_KEY}}" "${{secrets.OTA_UPLOAD_ENDPOINT}}?version=${VERSION}"

0 comments on commit 27fdc00

Please sign in to comment.