Skip to content

Commit f7bd7f0

Browse files
fix
1 parent 2bcbea8 commit f7bd7f0

3 files changed

Lines changed: 63 additions & 12 deletions

File tree

.github/workflows/release.yml

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,62 @@ jobs:
3434
- name: Compute next version tag
3535
id: version
3636
shell: bash
37+
env:
38+
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
3739
run: |
3840
set -euo pipefail
41+
# Semver bump from first line of commit message (priority: major > minor > patch).
42+
# patch (+0.0.1): fix, perf, patch, hotfix, … — default when no keyword matches.
43+
# minor (+0.1.0): minor, feat, feature, update
44+
# major (+1.0.0): major, breaking, break
45+
msg="$(printf '%s' "${COMMIT_MESSAGE}" | head -n1 | tr '[:upper:]' '[:lower:]')"
46+
bump="patch"
47+
if [[ "${msg}" =~ (^|[^a-z])(major|breaking|break)([^a-z]|$) ]]; then
48+
bump="major"
49+
elif [[ "${msg}" =~ (^|[^a-z])(minor|feature|feat|update)([^a-z]|$) ]]; then
50+
bump="minor"
51+
elif [[ "${msg}" =~ (^|[^a-z])(patch|fix|perf|hotfix)([^a-z]|$) ]]; then
52+
bump="patch"
53+
fi
54+
3955
latest_tag="$(git tag -l 'v[0-9]*' --sort=-v:refname | head -n1 || true)"
4056
if [[ -z "${latest_tag}" ]]; then
41-
next="v1.0"
57+
major=1
58+
minor=0
59+
patch=0
4260
else
4361
ver="${latest_tag#v}"
4462
if [[ "${ver}" =~ ^[0-9]+\.[0-9]+$ ]]; then
4563
IFS='.' read -r major minor <<< "${ver}"
46-
next="v${major}.$((minor + 1))"
64+
patch=0
4765
else
4866
IFS='.' read -r major minor patch _ <<< "${ver}."
4967
major="${major:-0}"
5068
minor="${minor:-0}"
5169
patch="${patch:-0}"
52-
next="v${major}.${minor}.$((patch + 1))"
5370
fi
5471
fi
72+
73+
case "${bump}" in
74+
major)
75+
major=$((major + 1))
76+
minor=0
77+
patch=0
78+
;;
79+
minor)
80+
minor=$((minor + 1))
81+
patch=0
82+
;;
83+
patch)
84+
patch=$((patch + 1))
85+
;;
86+
esac
87+
88+
next="v${major}.${minor}.${patch}"
5589
echo "latest=${latest_tag:-none}" >> "$GITHUB_OUTPUT"
5690
echo "tag=${next}" >> "$GITHUB_OUTPUT"
57-
echo "Next release tag: ${next} (previous: ${latest_tag:-none})"
91+
echo "bump=${bump}" >> "$GITHUB_OUTPUT"
92+
echo "Next release tag: ${next} (${bump} bump, previous: ${latest_tag:-none})"
5893
5994
- name: Setup Node.js
6095
uses: actions/setup-node@v4
@@ -93,10 +128,11 @@ jobs:
93128
run: |
94129
set -euo pipefail
95130
tag="${{ steps.version.outputs.tag }}"
131+
bump="${{ steps.version.outputs.bump }}"
96132
short_sha="${GITHUB_SHA::7}"
97133
body_file="$(mktemp)"
98134
{
99-
echo "Automated release for commit [\`${short_sha}\`](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA})."
135+
echo "Automated release for commit [\`${short_sha}\`](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}) (**${bump}** bump → \`${tag}\`)."
100136
echo ""
101137
echo "### Assets"
102138
echo "- \`Cheater_Detection.lua\` — bundled Lmaobox script (load from \`%localappdata%/lua/\`)"

Cheater_Detection/Main.lua

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,15 @@ end
264264
-- [[ Callbacks ]]
265265
local function OnCreateMove(cmd)
266266
-- Game logic only on CreateMove (never on Draw).
267-
Scheduler.Tick()
268-
269267
-- SetContext is expensive; Begin/End already no-op when profiler overlay is off.
270268
if isMenuProfilerEnabled() then
271269
Profiler.SetContext("tick")
272270
end
271+
272+
Profiler.Begin("Scheduler_Tick")
273+
Scheduler.Tick()
274+
Profiler.End("Scheduler_Tick")
275+
273276
Profiler.Begin("CreateMove_Total")
274277
local isGameUI = engine.IsGameUIVisible()
275278
if isGameUI then
@@ -307,8 +310,11 @@ local function OnCreateMove(cmd)
307310
return
308311
end
309312

313+
Profiler.Begin("CreateMove_Events")
310314
Events.DispatchEngineEvent("CreateMove", cmd)
315+
Profiler.End("CreateMove_Events")
311316

317+
Profiler.Begin("CreateMove_Prep")
312318
local menu = G.Menu
313319
local adv = menu.Advanced
314320

@@ -356,6 +362,7 @@ local function OnCreateMove(cmd)
356362
sessionState.groupSearched = false
357363
SteamLookup.StopGroupFetch()
358364
end
365+
Profiler.End("CreateMove_Prep")
359366
-- TickGroupFetch is paced in Scheduler.Tick, not the CreateMove hot path.
360367

361368
-- Sync authoritative live-player list and tick entity cache once per tick
@@ -375,15 +382,15 @@ local function OnCreateMove(cmd)
375382
end
376383
lastDetectorTick = curTick
377384

378-
-- Once per game tick: decay only for alive, non-dormant players (60s grace after HoldDecay).
385+
Profiler.Begin("Evidence_Decay")
379386
Evidence.ApplyDecay()
387+
Profiler.End("Evidence_Decay")
380388

381389
local isDebug = isDebugEnabled()
382390
local localID = tostring(Common.GetSteamID64(localPlayer) or "")
383391
local stateTable = PlayerCache.GetActiveTable()
384392

385393
-- Pre-filter active players into a flat list (reuse module-level table)
386-
Profiler.Begin("PlayerScan_Loop")
387394
Profiler.Begin("PlayerScan_BuildActive")
388395
for k = 1, #activePlayers do activePlayers[k] = nil end
389396
for id, existingState in pairs(stateTable) do
@@ -449,7 +456,6 @@ local function OnCreateMove(cmd)
449456
enforceValveAutoDisconnect(pState)
450457
if sessionState.valveDisconnectTriggered then
451458
Profiler.End("ValveCheck")
452-
Profiler.End("PlayerScan_Loop")
453459
Profiler.End("CreateMove_Total")
454460
return
455461
end
@@ -525,7 +531,6 @@ local function OnCreateMove(cmd)
525531
Profiler.End("FakeLag")
526532
end
527533

528-
Profiler.End("PlayerScan_Loop")
529534
Profiler.End("CreateMove_Total")
530535
end
531536

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,17 @@ We have completely re-engineered the backend storage and in-memory execution pip
6767

6868
[![Download Latest](https://img.shields.io/github/downloads/titaniummachine1/Cheater_Detection/total.svg?style=for-the-badge&logo=download&label=Download%20Latest)](https://github.com/titaniummachine1/Cheater_Detection/releases/latest/download/Cheater_Detection.lua)
6969

70-
Every push to `main` triggers [`.github/workflows/release.yml`](.github/workflows/release.yml): embedded DBs are rebuilt, Lua is bundled, the version tag is bumped (`v1.4``v1.5`, etc.), and a GitHub Release is published with:
70+
Every push to `main` triggers [`.github/workflows/release.yml`](.github/workflows/release.yml): embedded DBs are rebuilt, Lua is bundled, a semver tag is bumped from the **first line of the commit message**, and a GitHub Release is published with:
71+
72+
| Bump | Version change | Keywords in commit (examples) |
73+
|------|----------------|--------------------------------|
74+
| **patch** (default) | `+0.0.1` | `fix`, `perf`, `patch`, `hotfix` — or no keyword |
75+
| **minor** | `+0.1.0` (patch reset to 0) | `minor`, `feat`, `feature`, `update` |
76+
| **major** | `+1.0.0` (minor/patch reset) | `major`, `breaking`, `break` |
77+
78+
Example: `v1.4.2` + commit `perf: faster bhop gate``v1.4.3`. Commit `update: new detections``v1.5.0`. Commit `major: rewrite evidence``v2.0.0`.
79+
80+
Legacy tags like `v1.4` are treated as `v1.4.0` before bumping.
7181

7282
- `Cheater_Detection.lua` (bundled script)
7383
- `local_http_bridge_server.py` (optional bridge)

0 commit comments

Comments
 (0)