diff --git a/.github/workflows/build-firmware.yaml b/.github/workflows/build-firmware.yaml index 762541b..d5567d0 100644 --- a/.github/workflows/build-firmware.yaml +++ b/.github/workflows/build-firmware.yaml @@ -26,8 +26,10 @@ jobs: run: bash ./build.sh working-directory: ./proj - name: Read version + if: ${{ env.SKIP_BUILd != '1' }} run: echo "VERSION=$(head -c 8 ./proj/.versum)" >> $GITHUB_ENV - uses: ncipollo/release-action@v1 + if: ${{ env.SKIP_BUILd != '1' }} with: artifacts: "./proj/build/*.bin" generateReleaseNotes: true diff --git a/proj/build.sh b/proj/build.sh index cc1c5c3..a0e3f94 100755 --- a/proj/build.sh +++ b/proj/build.sh @@ -2,7 +2,7 @@ # If token is in env, then check if latest release hash is the same as the current files hash, # if it is stop the build, if it is not continue the build -if [ -z "$GH_TOKEN" ]; then +if [ ! -z "$GH_TOKEN" ]; then FILES_HASH=$(find ./platformio.ini ./src ./lib ./include -type f -print0 | sort -fdz | xargs -0 sha1sum | grep -v ./src/version.h | sha1sum | awk '{print $1}') FILES_HASH=${FILES_HASH:0:8} @@ -11,7 +11,8 @@ if [ -z "$GH_TOKEN" ]; then if [ "$FILES_HASH" == "$RELEASE_HASH" ]; then echo "No changes in the files, stopping the build" - echo "::error::No changes in the files, stopping the build" + echo "SKIP_BUILD=1" >> $GITHUB_ENV + exit 0 fi fi