Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/semantic-bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Semantic Version Bump (Conventional Commits)

on:
push:
branches:
- main

permissions:
contents: write

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"
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
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 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"
4 changes: 0 additions & 4 deletions client/seatbelt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ local lastVeh = nil
local veloc

-- Functions

local function ejectFromVehicle()
local ped = PlayerPedId()
local veh = GetVehiclePedIsIn(ped, false)
Expand Down Expand Up @@ -92,7 +91,6 @@ end
exports("HasSeatbeltOn", hasSeatbeltOn)

-- Ejection Logic

RegisterNetEvent('QBCore:Client:EnteredVehicle', function()
local ped = PlayerPedId()
while IsPedInAnyVehicle(ped, false) do
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()))
Expand Down
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
7 changes: 1 addition & 6 deletions server/consumables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -66,7 +65,6 @@ QBCore.Functions.CreateUseableItem('meth', function(source)
end)

----------- / Tools

QBCore.Functions.CreateUseableItem('armor', function(source)
TriggerClientEvent('consumables:client:UseArmor', source)
end)
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand Down