diff --git a/.github/workflows/nightly_release.yml b/.github/workflows/nightly_release.yml index 69f253975..03ec9c512 100644 --- a/.github/workflows/nightly_release.yml +++ b/.github/workflows/nightly_release.yml @@ -12,7 +12,6 @@ jobs: nightly-release: runs-on: ubuntu-24.04 name: 🌃 Update Nightly Release - steps: - name: 🧰 Checkout uses: actions/checkout@v4 @@ -22,13 +21,19 @@ jobs: fetch-tags: true - name: 🌃 Check for new commits + id: check_commits run: | + cd ImHex + git config --global --add safe.directory $(pwd) if [ -z "$(git log nightly..HEAD --oneline)" ]; then echo "No new commits since last nightly. Exiting." - exit 0 + echo "::set-output name=should_run::false" + else + echo "::set-output name=should_run::true" fi - name: 📜 Set version variable + if: ${{ steps.check_commits.outputs.should_run == 'true' }} run: | project_version=`cat ImHex/VERSION` echo "IMHEX_VERSION=$project_version" >> $GITHUB_ENV @@ -43,6 +48,7 @@ jobs: skip_unpack: true - name: 🗜️ Unzip files when needed + if: ${{ steps.check_commits.outputs.should_run == 'true' }} run: | set -x for zipfile in ./*.zip @@ -58,6 +64,7 @@ jobs: done - name: 🟩 Rename artifacts when needed + if: ${{ steps.check_commits.outputs.should_run == 'true' }} run: | mv "Windows Portable x86_64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-x86_64.zip mv "Windows Portable arm64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-arm64.zip @@ -66,6 +73,7 @@ jobs: rm artifact.tar || true - name: 📖 Generate Release Notes + if: ${{ steps.check_commits.outputs.should_run == 'true' }} id: release_notes continue-on-error: true run: | @@ -75,6 +83,7 @@ jobs: git log nightly..origin/master --oneline --no-merges --pretty=format:'* %s' >> changelog.md - name: 📦 Update Pre-Release + if: ${{ steps.check_commits.outputs.should_run == 'true' }} run: | set -e @@ -99,6 +108,7 @@ jobs: gh release upload nightly ../*.* --clobber - name: ⬆️ Publish x86_64 Snap package + if: ${{ steps.check_commits.outputs.should_run == 'true' }} continue-on-error: true uses: snapcore/action-publish@v1 env: @@ -108,6 +118,7 @@ jobs: release: edge - name: ⬆️ Publish arm64 Snap package + if: ${{ steps.check_commits.outputs.should_run == 'true' }} continue-on-error: true uses: snapcore/action-publish@v1 env: