From 8ab526b0f4c63628f310acb0e86716584a1e2086 Mon Sep 17 00:00:00 2001 From: Stevie <43250308+QBStevie@users.noreply.github.com> Date: Thu, 10 Apr 2025 23:09:14 +0100 Subject: [PATCH 1/5] Add files via upload --- .github/workflows/semantic-bump-version.yml | 75 +++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/semantic-bump-version.yml diff --git a/.github/workflows/semantic-bump-version.yml b/.github/workflows/semantic-bump-version.yml new file mode 100644 index 00000000..66a3543b --- /dev/null +++ b/.github/workflows/semantic-bump-version.yml @@ -0,0 +1,75 @@ +name: Semantic Version Bump (Conventional Commits) + +on: + push: + branches: + - main + +jobs: + semver-bump: + runs-on: ubuntu-latest + if: github.event.head_commit.author.name != 'github-actions[bot]' + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Determine bump type from commit message + id: bump + run: | + COMMIT_MSG="${{ github.event.head_commit.message }}" + echo "🔍 Commit message: $COMMIT_MSG" + + 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 + + - 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" + + 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 + + NEW_VERSION="$MAJOR.$MINOR.$PATCH" + sed -i "s/version ['\"]$VERSION['\"]/version '$NEW_VERSION'/" "$FILE" + echo "new_version=$NEW_VERSION" >> $GITHUB_ENV + + - 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 + + if git diff --cached --quiet; then + echo "⚠️ No version changes to commit." + exit 0 + fi + + COMMIT_MSG="${{ github.event.head_commit.message }}" + git commit -m "ci: bump fxmanifest version to ${{ env.new_version }} – $COMMIT_MSG" + git push \ No newline at end of file From 5812226edac5df3f38d9e5a32e3117d1e5c4aa48 Mon Sep 17 00:00:00 2001 From: Stevie <43250308+QBStevie@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:57:02 +0100 Subject: [PATCH 2/5] feat!: bump --- server/consumables.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/server/consumables.lua b/server/consumables.lua index 69df6db3..ac629141 100644 --- a/server/consumables.lua +++ b/server/consumables.lua @@ -8,7 +8,6 @@ for k, _ in pairs(Config.Consumables.alcohol) do end ----------- / Eat - for k, _ in pairs(Config.Consumables.eat) do QBCore.Functions.CreateUseableItem(k, function(source, item) if not exports['qb-inventory']:RemoveItem(source, item.name, 1, item.slot, 'qb-smallresources:consumables:eat') then return end @@ -38,8 +37,8 @@ local function createItem(name, type) TriggerClientEvent('consumables:client:' .. type, source, item.name) end) end ------------ / Drug +----------- / Drug QBCore.Functions.CreateUseableItem('joint', function(source, item) if not exports['qb-inventory']:RemoveItem(source, item.name, 1, item.slot, 'qb-smallresources:joint') then return end TriggerClientEvent('consumables:client:UseJoint', source) @@ -66,7 +65,6 @@ QBCore.Functions.CreateUseableItem('meth', function(source) end) ----------- / Tools - QBCore.Functions.CreateUseableItem('armor', function(source) TriggerClientEvent('consumables:client:UseArmor', source) end) @@ -98,7 +96,6 @@ QBCore.Commands.Add('resetparachute', 'Resets Parachute', {}, false, function(so end) ----------- / Firework - for _, v in pairs(Config.Fireworks.items) do QBCore.Functions.CreateUseableItem(v, function(source, item) local src = source @@ -107,7 +104,6 @@ for _, v in pairs(Config.Fireworks.items) do end ----------- / Lockpicking - QBCore.Functions.CreateUseableItem('lockpick', function(source) TriggerClientEvent('lockpicks:UseLockpick', source, false) end) @@ -117,7 +113,6 @@ QBCore.Functions.CreateUseableItem('advancedlockpick', function(source) end) -- Events for adding and removing specific items to fix some exploits - RegisterNetEvent('consumables:server:AddParachute', function() local Player = QBCore.Functions.GetPlayer(source) if not Player then return end From 51d8aa9b31203a99a09296b4cbc0e26e355ec90d Mon Sep 17 00:00:00 2001 From: Stevie <43250308+QBStevie@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:59:35 +0100 Subject: [PATCH 3/5] Update semantic-bump-version.yml --- .github/workflows/semantic-bump-version.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/semantic-bump-version.yml b/.github/workflows/semantic-bump-version.yml index 66a3543b..c21970c4 100644 --- a/.github/workflows/semantic-bump-version.yml +++ b/.github/workflows/semantic-bump-version.yml @@ -5,6 +5,9 @@ on: branches: - main +permissions: + contents: write + jobs: semver-bump: runs-on: ubuntu-latest @@ -34,9 +37,13 @@ jobs: 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]+") + if [[ ! -f "$FILE" ]]; then + echo "ERROR: fxmanifest.lua not found. Exiting." + exit 1 + fi + 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" case "${{ steps.bump.outputs.bump }}" in @@ -72,4 +79,11 @@ jobs: COMMIT_MSG="${{ github.event.head_commit.message }}" git commit -m "ci: bump fxmanifest version to ${{ env.new_version }} – $COMMIT_MSG" - git push \ No newline at end of file + git push origin HEAD:main + + - name: Create and push Git tag + if: steps.bump.outputs.bump != 'none' + run: | + TAG="v${{ env.new_version }}" + git tag "$TAG" + git push origin "$TAG" From 16ae72cdd37536bbdb8b043f272bf1f99fbb2cec Mon Sep 17 00:00:00 2001 From: Stevie <43250308+QBStevie@users.noreply.github.com> Date: Thu, 5 Jun 2025 15:02:02 +0100 Subject: [PATCH 4/5] feat!: bump --- client/seatbelt.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/client/seatbelt.lua b/client/seatbelt.lua index 18ee93b8..a0f2ac56 100644 --- a/client/seatbelt.lua +++ b/client/seatbelt.lua @@ -18,7 +18,6 @@ local lastVeh = nil local veloc -- Functions - local function ejectFromVehicle() local ped = PlayerPedId() local veh = GetVehiclePedIsIn(ped, false) @@ -92,7 +91,6 @@ end exports("HasSeatbeltOn", hasSeatbeltOn) -- Ejection Logic - RegisterNetEvent('QBCore:Client:EnteredVehicle', function() local ped = PlayerPedId() while IsPedInAnyVehicle(ped, false) do @@ -231,7 +229,6 @@ RegisterNetEvent('QBCore:Client:EnteredVehicle', function() end) -- Events - RegisterNetEvent('seatbelt:client:UseHarness', function(ItemData) -- On Item Use (registered server side) local ped = PlayerPedId() local inVeh = IsPedInAnyVehicle(ped, false) @@ -270,7 +267,6 @@ RegisterNetEvent('seatbelt:client:UseHarness', function(ItemData) -- On Item Use end) -- Register Key - RegisterCommand('toggleseatbelt', function() if not IsPedInAnyVehicle(PlayerPedId(), false) or IsPauseMenuActive() then return end local class = GetVehicleClass(GetVehiclePedIsUsing(PlayerPedId())) From 4528042e6ebb7f72b9e6ad20584eb8d3d52af5a5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Jun 2025 14:02:12 +0000 Subject: [PATCH 5/5] =?UTF-8?q?ci:=20bump=20fxmanifest=20version=20to=202.?= =?UTF-8?q?0.0=20=E2=80=93=20feat!:=20bump?= 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 9ddd213f..ba32ddc5 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -4,7 +4,7 @@ lua54 'yes' use_experimental_fxv2_oal 'yes' author 'Kakarot' description 'Various small code snippets compiled into one resource for ease of use' -version '1.4.0' +version '2.0.0' shared_scripts { '@qb-core/shared/locale.lua',