Skip to content

Commit

Permalink
explore: test github build hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
filipton committed Feb 24, 2024
1 parent 9522c64 commit 32c0fde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-firmware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions proj/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -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
Expand Down

0 comments on commit 32c0fde

Please sign in to comment.