From 64842dc132fb4d8e72b9dd04c79af62fe8d3550c Mon Sep 17 00:00:00 2001 From: Stevie <43250308+QBStevie@users.noreply.github.com> Date: Thu, 10 Apr 2025 22:50:11 +0100 Subject: [PATCH 1/7] auto dump version --- .github/workflows/dump-version.yml | 63 ++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/dump-version.yml diff --git a/.github/workflows/dump-version.yml b/.github/workflows/dump-version.yml new file mode 100644 index 0000000..b6ccafe --- /dev/null +++ b/.github/workflows/dump-version.yml @@ -0,0 +1,63 @@ +name: Auto Bump FXManifest Version + +on: + push: + branches: + - main # Change if your default branch is different + +jobs: + bump-version: + runs-on: ubuntu-latest + if: github.event.head_commit.author.name != 'github-actions[bot]' + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Bump version in fxmanifest.lua + run: | + FILE="fxmanifest.lua" + echo "Reading version from $FILE" + + # Extract the version line + VERSION_LINE=$(grep -E "version ['\"]?[0-9]+\.[0-9]+\.[0-9]+['\"]?" "$FILE") + echo "Found version line: $VERSION_LINE" + + if [[ -z "$VERSION_LINE" ]]; then + echo "❌ No version line found in $FILE" + exit 1 + fi + + # Extract the version number + VERSION=$(echo "$VERSION_LINE" | grep -oE "[0-9]+\.[0-9]+\.[0-9]+") + IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION" + + # Increment patch version + PATCH=$((PATCH + 1)) + NEW_VERSION="$MAJOR.$MINOR.$PATCH" + + echo "🔧 Bumping version: $VERSION → $NEW_VERSION" + + # Replace the old version with the new one + sed -i "s/version ['\"]$VERSION['\"]/version '$NEW_VERSION'/" "$FILE" + + echo "✅ Updated fxmanifest.lua to version $NEW_VERSION" + + - name: Commit and push changes + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add fxmanifest.lua + + # Check if there is actually a diff + if git diff --cached --quiet; then + echo "⚠️ No changes to commit." + exit 0 + fi + + # Grab the latest commit message that triggered this action + LATEST_MSG=$(git log -1 --pretty=%B) + + # Commit with context from the change that caused the bump + git commit -m "ci: bump fxmanifest version – ${LATEST_MSG}" + git push From a7c2bb462e78d8283a91ee76ac4a6eeb881ce997 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 10 Apr 2025 21:50:22 +0000 Subject: [PATCH 2/7] =?UTF-8?q?ci:=20bump=20fxmanifest=20version=20?= =?UTF-8?q?=E2=80=93=20auto=20dump=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fxmanifest.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fxmanifest.lua b/fxmanifest.lua index c131525..f04bbe3 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -3,7 +3,7 @@ game 'gta5' lua54 'yes' author 'Kakarot' description 'Loading screen' -version '1.2.0' +version '1.2.1' files { 'assets/**', From 4f43addc90dc722f1cf90ddab08055c22d11b4f2 Mon Sep 17 00:00:00 2001 From: Stevie <43250308+QBStevie@users.noreply.github.com> Date: Thu, 10 Apr 2025 22:52:45 +0100 Subject: [PATCH 3/7] Update index.html --- html/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/html/index.html b/html/index.html index 459db4c..480b7fd 100644 --- a/html/index.html +++ b/html/index.html @@ -11,6 +11,7 @@ + From 5ac27cd2eb6e0f1aed6fbad220ad5775d5237219 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 10 Apr 2025 21:52:53 +0000 Subject: [PATCH 4/7] =?UTF-8?q?ci:=20bump=20fxmanifest=20version=20?= =?UTF-8?q?=E2=80=93=20Update=20index.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fxmanifest.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fxmanifest.lua b/fxmanifest.lua index f04bbe3..e793438 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -3,7 +3,7 @@ game 'gta5' lua54 'yes' author 'Kakarot' description 'Loading screen' -version '1.2.1' +version '1.2.2' files { 'assets/**', From 7cb24a6590877c8dee05a44cbe18082d4debff2b Mon Sep 17 00:00:00 2001 From: Stevie <43250308+QBStevie@users.noreply.github.com> Date: Thu, 10 Apr 2025 23:00:10 +0100 Subject: [PATCH 5/7] Update dump-version.yml --- .github/workflows/dump-version.yml | 74 +++++++++++++++++------------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/.github/workflows/dump-version.yml b/.github/workflows/dump-version.yml index b6ccafe..dd20c2d 100644 --- a/.github/workflows/dump-version.yml +++ b/.github/workflows/dump-version.yml @@ -1,63 +1,75 @@ -name: Auto Bump FXManifest Version +name: Semantic Version Bump (Conventional Commits) on: push: branches: - - main # Change if your default branch is different + - main jobs: - bump-version: + semver-bump: runs-on: ubuntu-latest if: github.event.head_commit.author.name != 'github-actions[bot]' steps: - - name: Checkout repository + - name: Checkout code uses: actions/checkout@v3 - - name: Bump version in fxmanifest.lua + - name: Determine bump type from commit message + id: bump run: | - FILE="fxmanifest.lua" - echo "Reading version from $FILE" - - # Extract the version line - VERSION_LINE=$(grep -E "version ['\"]?[0-9]+\.[0-9]+\.[0-9]+['\"]?" "$FILE") - echo "Found version line: $VERSION_LINE" + COMMIT_MSG="${{ github.event.head_commit.message }}" + echo "🔍 Commit message: $COMMIT_MSG" - if [[ -z "$VERSION_LINE" ]]; then - echo "❌ No version line found in $FILE" - exit 1 + if echo "$COMMIT_MSG" | grep -qE 'BREAKING CHANGE|!:'; then + echo "bump=major" >> $GITHUB_OUTPUT + elif echo "$COMMIT_MSG" | grep -qE '^feat(\(.+\))?:'; then + echo "bump=minor" >> $GITHUB_OUTPUT + elif echo "$COMMIT_MSG" | grep -qE '^fix(\(.+\))?:'; then + echo "bump=patch" >> $GITHUB_OUTPUT + else + echo "bump=none" >> $GITHUB_OUTPUT fi - # Extract the version number + - name: Bump version in fxmanifest.lua + if: steps.bump.outputs.bump != 'none' + run: | + FILE="fxmanifest.lua" + VERSION_LINE=$(grep -E "version ['\"]?[0-9]+\.[0-9]+\.[0-9]+['\"]?" "$FILE") VERSION=$(echo "$VERSION_LINE" | grep -oE "[0-9]+\.[0-9]+\.[0-9]+") - IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION" - # Increment patch version - PATCH=$((PATCH + 1)) - NEW_VERSION="$MAJOR.$MINOR.$PATCH" + IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION" - echo "🔧 Bumping version: $VERSION → $NEW_VERSION" + case "${{ steps.bump.outputs.bump }}" in + major) + MAJOR=$((MAJOR + 1)) + MINOR=0 + PATCH=0 + ;; + minor) + MINOR=$((MINOR + 1)) + PATCH=0 + ;; + patch) + PATCH=$((PATCH + 1)) + ;; + esac - # Replace the old version with the new one + NEW_VERSION="$MAJOR.$MINOR.$PATCH" sed -i "s/version ['\"]$VERSION['\"]/version '$NEW_VERSION'/" "$FILE" + echo "new_version=$NEW_VERSION" >> $GITHUB_ENV - echo "✅ Updated fxmanifest.lua to version $NEW_VERSION" - - - name: Commit and push changes + - name: Commit and push version bump + if: steps.bump.outputs.bump != 'none' run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add fxmanifest.lua - # Check if there is actually a diff if git diff --cached --quiet; then - echo "⚠️ No changes to commit." + echo "⚠️ No version changes to commit." exit 0 fi - # Grab the latest commit message that triggered this action - LATEST_MSG=$(git log -1 --pretty=%B) - - # Commit with context from the change that caused the bump - git commit -m "ci: bump fxmanifest version – ${LATEST_MSG}" + COMMIT_MSG="${{ github.event.head_commit.message }}" + git commit -m "ci: bump fxmanifest version to ${{ env.new_version }} – $COMMIT_MSG" git push From 86360c2eb2692940231f28f73dfda1af6f721acd Mon Sep 17 00:00:00 2001 From: Stevie <43250308+QBStevie@users.noreply.github.com> Date: Thu, 10 Apr 2025 23:03:13 +0100 Subject: [PATCH 6/7] fix: Update index.html --- html/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/html/index.html b/html/index.html index 480b7fd..f417493 100644 --- a/html/index.html +++ b/html/index.html @@ -11,6 +11,7 @@ + From 772b0e4da45fa9fddba3c7191f083536373005a3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 10 Apr 2025 22:03:23 +0000 Subject: [PATCH 7/7] =?UTF-8?q?ci:=20bump=20fxmanifest=20version=20to=201.?= =?UTF-8?q?2.3=20=E2=80=93=20fix:=20Update=20index.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fxmanifest.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fxmanifest.lua b/fxmanifest.lua index e793438..496f521 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -3,7 +3,7 @@ game 'gta5' lua54 'yes' author 'Kakarot' description 'Loading screen' -version '1.2.2' +version '1.2.3' files { 'assets/**',