git: Fix nightly release runner running when there's nothing to do

This commit is contained in:
WerWolv 2025-10-14 22:11:55 +02:00
parent 2f0efa1197
commit c6caa1d067
1 changed files with 13 additions and 2 deletions

View File

@ -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: