From 424e3128428b04d9c526503a88f537fadd2257e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Wed, 1 Nov 2023 16:59:59 +0100 Subject: [PATCH] better way to grab version --- .github/workflows/build-ota-updates.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-ota-updates.yml b/.github/workflows/build-ota-updates.yml index 1ba170a90e..48e1dbf5f1 100644 --- a/.github/workflows/build-ota-updates.yml +++ b/.github/workflows/build-ota-updates.yml @@ -14,8 +14,6 @@ jobs: steps: - uses: actions/checkout@v4 - with: - fetch-tags: true - name: Install GNU gettext run: sudo apt-get install gettext @@ -25,7 +23,6 @@ jobs: - name: Upload OTA updates run: | - git fetch --tags - VERSION=$(git describe --tags --match 'v*' | sed -e 's/v\([0-9]\+\)\.\([0-9]\+\).*/\1.\2/g') - echo "ota version: $VERSION" - curl -F 'data=@ota-update.tar' -H "X-Api-Key: ${{secrets.OTA_API_KEY}}" "${{secrets.OTA_UPLOAD_ENDPOINT}}?version=${VERSION}" + 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}"