From 27fdc00e3b497963e3cb91236a0d3ee27657253d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Wed, 1 Nov 2023 16:41:27 +0100 Subject: [PATCH] Add GHA workflow to build OTA updates --- .github/workflows/build-ota-updates.yml | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/build-ota-updates.yml diff --git a/.github/workflows/build-ota-updates.yml b/.github/workflows/build-ota-updates.yml new file mode 100644 index 0000000000..d47c5fc761 --- /dev/null +++ b/.github/workflows/build-ota-updates.yml @@ -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 'data=@ota-update.tar' -H "X-Api-Key: ${{secrets.OTA_API_KEY}}" "${{secrets.OTA_UPLOAD_ENDPOINT}}?version=${VERSION}"