From fc1a4b42e5b7bf8277290ff50a6a3ec9a5e2f231 Mon Sep 17 00:00:00 2001 From: Stevie <43250308+QBStevie@users.noreply.github.com> Date: Thu, 10 Apr 2025 23:17:27 +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 000000000..66a3543bb --- /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 85bc71416a680956ba5ff864ccd0189c32b81d78 Mon Sep 17 00:00:00 2001 From: Stevie <43250308+QBStevie@users.noreply.github.com> Date: Fri, 11 Apr 2025 03:44:55 +0100 Subject: [PATCH 2/5] Update functions.lua --- server/functions.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/server/functions.lua b/server/functions.lua index a7f203a4e..0622d8dd7 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -7,7 +7,6 @@ QBCore.UsableItems = {} -- Get your player first and then trigger a function on them -- ex: local player = QBCore.Functions.GetPlayer(source) -- ex: local example = player.Functions.functionname(parameter) - ---Gets the coordinates of an entity ---@param entity number ---@return vector4 From d293239c712450bb19d979d020753c7591017243 Mon Sep 17 00:00:00 2001 From: Stevie <43250308+QBStevie@users.noreply.github.com> Date: Fri, 11 Apr 2025 04:23:35 +0100 Subject: [PATCH 3/5] Update functions.lua --- server/functions.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/server/functions.lua b/server/functions.lua index 0622d8dd7..4be4245e9 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -733,6 +733,5 @@ for functionName, func in pairs(QBCore.Functions) do exports(functionName, func) end end - -- Access a specific function directly: -- exports['qb-core']:Notify(source, 'Hello Player!') From eabfb140868d7fee9b1a91b3257cdf65e3121ac3 Mon Sep 17 00:00:00 2001 From: Stevie <43250308+QBStevie@users.noreply.github.com> Date: Fri, 11 Apr 2025 04:24:56 +0100 Subject: [PATCH 4/5] Update functions.lua --- server/functions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/functions.lua b/server/functions.lua index 4be4245e9..79e388c4d 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -394,7 +394,7 @@ function QBCore.Functions.CreateVehicle(source, model, vehtype, coords, warp) end function PaycheckInterval() - if not next(QBCore.Players) then + if not next(QBCore.Players) then SetTimeout(QBCore.Config.Money.PayCheckTimeOut * (60 * 1000), PaycheckInterval) -- Prevent paychecks from stopping forever once 0 players return end From 76dcd087df6c38db06679b2cd1859d35aa530145 Mon Sep 17 00:00:00 2001 From: Stevie <43250308+QBStevie@users.noreply.github.com> Date: Fri, 11 Apr 2025 04:26:31 +0100 Subject: [PATCH 5/5] Update functions.lua --- server/functions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/functions.lua b/server/functions.lua index 79e388c4d..4bb1f18c4 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -396,7 +396,7 @@ end function PaycheckInterval() if not next(QBCore.Players) then SetTimeout(QBCore.Config.Money.PayCheckTimeOut * (60 * 1000), PaycheckInterval) -- Prevent paychecks from stopping forever once 0 players - return + return end for _, Player in pairs(QBCore.Players) do if not Player then return end