Skip to content

Commit 7562568

Browse files
authored
Merge pull request #1193 from Stevie-World/main
Semantic Version Bump
2 parents aaa8ada + 76dcd08 commit 7562568

File tree

2 files changed

+75
-2
lines changed

2 files changed

+75
-2
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Semantic Version Bump (Conventional Commits)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
semver-bump:
10+
runs-on: ubuntu-latest
11+
if: github.event.head_commit.author.name != 'github-actions[bot]'
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Determine bump type from commit message
18+
id: bump
19+
run: |
20+
COMMIT_MSG="${{ github.event.head_commit.message }}"
21+
echo "🔍 Commit message: $COMMIT_MSG"
22+
23+
if echo "$COMMIT_MSG" | grep -qE 'BREAKING CHANGE|!:'; then
24+
echo "bump=major" >> $GITHUB_OUTPUT
25+
elif echo "$COMMIT_MSG" | grep -qE '^feat(\(.+\))?:'; then
26+
echo "bump=minor" >> $GITHUB_OUTPUT
27+
elif echo "$COMMIT_MSG" | grep -qE '^fix(\(.+\))?:'; then
28+
echo "bump=patch" >> $GITHUB_OUTPUT
29+
else
30+
echo "bump=none" >> $GITHUB_OUTPUT
31+
fi
32+
33+
- name: Bump version in fxmanifest.lua
34+
if: steps.bump.outputs.bump != 'none'
35+
run: |
36+
FILE="fxmanifest.lua"
37+
VERSION_LINE=$(grep -E "version ['\"]?[0-9]+\.[0-9]+\.[0-9]+['\"]?" "$FILE")
38+
VERSION=$(echo "$VERSION_LINE" | grep -oE "[0-9]+\.[0-9]+\.[0-9]+")
39+
40+
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
41+
42+
case "${{ steps.bump.outputs.bump }}" in
43+
major)
44+
MAJOR=$((MAJOR + 1))
45+
MINOR=0
46+
PATCH=0
47+
;;
48+
minor)
49+
MINOR=$((MINOR + 1))
50+
PATCH=0
51+
;;
52+
patch)
53+
PATCH=$((PATCH + 1))
54+
;;
55+
esac
56+
57+
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
58+
sed -i "s/version ['\"]$VERSION['\"]/version '$NEW_VERSION'/" "$FILE"
59+
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
60+
61+
- name: Commit and push version bump
62+
if: steps.bump.outputs.bump != 'none'
63+
run: |
64+
git config user.name "github-actions[bot]"
65+
git config user.email "github-actions[bot]@users.noreply.github.com"
66+
git add fxmanifest.lua
67+
68+
if git diff --cached --quiet; then
69+
echo "⚠️ No version changes to commit."
70+
exit 0
71+
fi
72+
73+
COMMIT_MSG="${{ github.event.head_commit.message }}"
74+
git commit -m "ci: bump fxmanifest version to ${{ env.new_version }} – $COMMIT_MSG"
75+
git push

server/functions.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ QBCore.UsableItems = {}
77
-- Get your player first and then trigger a function on them
88
-- ex: local player = QBCore.Functions.GetPlayer(source)
99
-- ex: local example = player.Functions.functionname(parameter)
10-
1110
---Gets the coordinates of an entity
1211
---@param entity number
1312
---@return vector4
@@ -734,6 +733,5 @@ for functionName, func in pairs(QBCore.Functions) do
734733
exports(functionName, func)
735734
end
736735
end
737-
738736
-- Access a specific function directly:
739737
-- exports['qb-core']:Notify(source, 'Hello Player!')

0 commit comments

Comments
 (0)