Skip to content

Commit d59a532

Browse files
committed
.
1 parent d0a7a4b commit d59a532

File tree

3 files changed

+127
-0
lines changed

3 files changed

+127
-0
lines changed

.github/workflows/lint.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Lint
2+
on: [push, pull_request_target]
3+
jobs:
4+
lint:
5+
name: Lint Resource
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
with:
10+
ref: ${{ github.event.pull_request.head.sha }}
11+
- name: Lint
12+
uses: iLLeniumStudios/fivem-lua-lint-action@v2
13+
with:
14+
capture: "junit.xml"
15+
args: "-t --formatter JUnit"
16+
extra_libs: mysql
17+
- name: Generate Lint Report
18+
if: always()
19+
uses: mikepenz/action-junit-report@v3
20+
with:
21+
report_paths: "**/junit.xml"
22+
check_name: Linting Report
23+
fail_on_failure: false
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

.github/workflows/stale.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
2+
#
3+
# You can adjust the behavior by modifying this file.
4+
# For more information, see:
5+
# https://github.com/actions/stale
6+
name: Mark stale issues and pull requests
7+
8+
on:
9+
schedule:
10+
- cron: '41 15 * * *'
11+
12+
jobs:
13+
stale:
14+
15+
runs-on: ubuntu-latest
16+
permissions:
17+
issues: write
18+
pull-requests: write
19+
20+
steps:
21+
- uses: actions/stale@v5
22+
with:
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}
24+
stale-issue-message: 'This issue has had 60 days of inactivity & will close within 7 days'
25+
stale-pr-message: 'This PR has had 60 days of inactivity & will close within 7 days'
26+
close-issue-label: 'Stale Closed'
27+
close-pr-label: 'Stale Closed'
28+
exempt-issue-labels: 'Suggestion'
29+
exempt-pr-labels: 'Suggestion'

0 commit comments

Comments
 (0)