From ed5c5089b33308787cdb7f3336a9d3a35c9641e5 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Wed, 29 Jan 2025 21:25:24 +0100 Subject: [PATCH] Automagically tag shit --- .github/workflows/release.yml | 26 ++++++++++++++++++++++++++ release.sh | 12 +----------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 599fa2e..5905c0d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,9 +13,35 @@ jobs: - name: Install zip run: sudo apt-get install zip + - name: Configure Git + run: | + git config --global user.name "Git Admin" + git config --global user.email "gitadmin@quack-lab.dev" + - name: Run deploy script run: bash deploy.sh + - name: Check for Existing Release Commit + id: check_release_commit + run: | + # Check if the latest commit is a release commit + if git log -1 --pretty=%B | grep -q "Release"; then + echo "Release commit found. Skipping version bump." + echo "::set-output name=release_commit::true" + else + echo "No release commit found. Proceeding with version bump." + echo "::set-output name=release_commit::false" + fi + + - name: Run Release Script + if: steps.check_release_commit.outputs.release_commit == 'false' + run: bash release.sh + + - name: Push Changes + if: steps.check_release_commit.outputs.release_commit == 'false' + run: | + git push origin HEAD:refs/heads/master --tags + - name: Determine Tag id: determine_tag run: | diff --git a/release.sh b/release.sh index 8e820fe..d516195 100644 --- a/release.sh +++ b/release.sh @@ -35,18 +35,8 @@ NEW_VERSION=$(increment_version "$CURRENT_VERSION" "$INCREMENT") sed -i "s/## Version: $CURRENT_VERSION/## Version: $NEW_VERSION/" Heimdall.toc sed -i "s/local VERSION = \"$CURRENT_VERSION\"/local VERSION = \"$NEW_VERSION\"/" Heimdall.lua -# Existing deployment steps -rm Heimdall.zip -mkdir Heimdall -cp *.lua *.toc Heimdall -cp -r Modules Heimdall -cp -r Sounds Heimdall -cp -r Texture Heimdall -7z a Heimdall.zip Heimdall -rm -rf Heimdall - # Git operations -git add Heimdall.lua Heimdall.toc Heimdall.zip +git add Heimdall.lua Heimdall.toc git commit -m "Release $NEW_VERSION" git tag "$NEW_VERSION"