Skip to content

Commit 2f76660

Browse files
authored
Merge branch 'SirPlease:master' into fix/ratemonitor
2 parents b38dd10 + 62a3aa1 commit 2f76660

471 files changed

Lines changed: 9628 additions & 5309 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/check_plugins.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232
#- "1.10"
3333
#- "1.11"
3434
- "1.12"
35-
- "1.13"
35+
- "1.13.7296"
3636

3737
steps:
38-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v5
3939
- name: Set environment variables
4040
run: |
4141
echo "SCRIPTS_PATH=$GITHUB_WORKSPACE/addons/sourcemod/scripting" >> $GITHUB_ENV

.github/workflows/release.yml

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
name: Build release packages
2+
3+
# Owner-only. workflow_dispatch already requires repo write access, and the
4+
# job-level `if` below additionally restricts execution to the repository
5+
# owner, so only the owner can produce a release.
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Release version / tag (e.g. v3.0)'
11+
required: true
12+
type: string
13+
prerelease:
14+
description: 'Mark the GitHub Release as a pre-release'
15+
required: false
16+
type: boolean
17+
default: false
18+
19+
permissions:
20+
contents: write
21+
22+
concurrency:
23+
group: release-${{ inputs.version }}
24+
cancel-in-progress: false
25+
26+
jobs:
27+
release:
28+
name: Compile plugins and package ${{ inputs.version }}
29+
runs-on: ubuntu-latest
30+
# Hard gate: only the repository owner may run this workflow.
31+
if: github.actor == github.repository_owner
32+
33+
steps:
34+
- uses: actions/checkout@v5
35+
36+
# Same upstream compiler our check_plugins.yml CI gates on — pinned to
37+
# SourceMod 1.12. Putting `spcomp` on PATH for the next step.
38+
- name: Setup SourcePawn Compiler (SourceMod 1.12)
39+
uses: rumblefrog/setup-sp@master
40+
with:
41+
version: "1.12"
42+
43+
- name: Compile every shipped plugin from source
44+
run: |
45+
set -euo pipefail
46+
SCRIPTING="$GITHUB_WORKSPACE/addons/sourcemod/scripting"
47+
PLUGINS="$GITHUB_WORKSPACE/addons/sourcemod/plugins"
48+
49+
# Compile with the upstream SourceMod 1.12 compiler from
50+
# rumblefrog/setup-sp (on PATH), NOT the spcomp binary committed in
51+
# the repo — a known, reproducible toolchain. The -i include paths
52+
# below still point at the repo's own sources/includes.
53+
COMPILER="spcomp"
54+
55+
BUILD="$(mktemp -d)"
56+
declare -A BUILT
57+
FAILED=""
58+
COUNT=0
59+
60+
# Drive off the .smx files that ship in the repo: each one is
61+
# rebuilt from its same-named .sp source and written straight back
62+
# to its original path (root / fixes / optional / disabled / etc.).
63+
while IFS= read -r -d '' smx; do
64+
name="$(basename "$smx" .smx)"
65+
66+
if [ -z "${BUILT[$name]:-}" ]; then
67+
if [ -f "$SCRIPTING/$name.sp" ]; then
68+
base="$SCRIPTING"
69+
inc="$SCRIPTING/include"
70+
elif [ -f "$SCRIPTING/sourcemod/$name.sp" ]; then
71+
# Stock SourceMod plugins live one level down with their
72+
# own include tree.
73+
base="$SCRIPTING/sourcemod"
74+
inc="$SCRIPTING/sourcemod/include"
75+
else
76+
echo "::error::No .sp source found for shipped plugin '$name' ($smx)"
77+
FAILED="$FAILED $name"
78+
continue
79+
fi
80+
81+
echo "Compiling $name ..."
82+
# Run with cwd = the scripting dir and a bare source filename,
83+
# exactly like check_plugins.yml: some plugins (e.g. readyup)
84+
# use working-directory-relative quoted #includes that only
85+
# resolve from there. -i / -o / $BUILD are absolute, so the
86+
# subshell cd does not affect them.
87+
if ( cd "$base" && "$COMPILER" -E -w234 -w217 -O2 -v2 -i "$inc" "-o$BUILD/$name.smx" "$name.sp" ); then
88+
BUILT[$name]="$BUILD/$name.smx"
89+
else
90+
echo "::error::Failed to compile '$name' ($base/$name.sp)"
91+
FAILED="$FAILED $name"
92+
continue
93+
fi
94+
fi
95+
96+
cp -f "${BUILT[$name]}" "$smx"
97+
COUNT=$((COUNT + 1))
98+
done < <(find "$PLUGINS" -name '*.smx' -print0)
99+
100+
echo "Refreshed $COUNT plugin file(s) from ${#BUILT[@]} unique source(s)."
101+
if [ -n "$FAILED" ]; then
102+
echo "::error::One or more plugins failed to build:$FAILED"
103+
exit 1
104+
fi
105+
106+
- name: Stage the drop-in overlay
107+
run: |
108+
set -euo pipefail
109+
STAGE="$GITHUB_WORKSPACE/.release"
110+
rm -rf "$STAGE"
111+
mkdir -p "$STAGE"
112+
113+
# Lean runtime overlay: only what gets dropped over left4dead2/.
114+
cp -a \
115+
addons cfg scripts \
116+
host.txt motd.txt myhost.txt mymotd.txt \
117+
README.md LICENSE \
118+
"$STAGE"/
119+
120+
# Exclude the SourcePawn sources and the bundled compiler from the
121+
# shipped overlay (the compiled .smx in plugins/ are what runs).
122+
rm -rf "$STAGE/addons/sourcemod/scripting"
123+
124+
echo "STAGE=$STAGE" >> "$GITHUB_ENV"
125+
126+
- name: Build Linux archive (.so natives only)
127+
run: |
128+
set -euo pipefail
129+
NAME="L4D2-Competitive-Rework-${{ inputs.version }}-linux"
130+
OUT="$GITHUB_WORKSPACE/$NAME.tar.gz"
131+
# Drop every Windows native; keep the .so files.
132+
tar -czf "$OUT" --exclude='*.dll' -C "$STAGE" .
133+
echo "LINUX_ASSET=$OUT" >> "$GITHUB_ENV"
134+
135+
- name: Build Windows archive (.dll natives only)
136+
run: |
137+
set -euo pipefail
138+
NAME="L4D2-Competitive-Rework-${{ inputs.version }}-windows"
139+
OUT="$GITHUB_WORKSPACE/$NAME.zip"
140+
# Drop every Linux native; keep the .dll files.
141+
( cd "$STAGE" && zip -qr "$OUT" . -x '*.so' )
142+
echo "WIN_ASSET=$OUT" >> "$GITHUB_ENV"
143+
144+
- name: Publish draft GitHub Release
145+
env:
146+
GH_TOKEN: ${{ github.token }}
147+
run: |
148+
set -euo pipefail
149+
VER="${{ inputs.version }}"
150+
PRE=""
151+
if [ "${{ inputs.prerelease }}" = "true" ]; then PRE="--prerelease"; fi
152+
153+
# Static platform preamble, built via printf so no YAML/shell
154+
# indentation leaks in and gets rendered as a markdown code block.
155+
# GitHub's auto-generated changelog (--generate-notes) is appended
156+
# after this by gh release create.
157+
NOTES="$RUNNER_TEMP/release-notes.md"
158+
{
159+
printf 'Automated build of `%s`.\n\n' "$VER"
160+
printf -- '- **Linux** (`*-linux.tar.gz`): `.so` natives only.\n'
161+
printf -- '- **Windows** (`*-windows.zip`): `.dll` natives only.\n\n'
162+
printf 'Drop-in overlay for `left4dead2/`. All `.smx` plugins are recompiled '
163+
printf 'from source with the upstream SourceMod 1.12 compiler '
164+
printf '(rumblefrog/setup-sp); SourcePawn sources are not included in the '
165+
printf 'archives.\n'
166+
} > "$NOTES"
167+
168+
# --draft: nothing goes public (and the git tag is NOT created)
169+
# until you review and click Publish on the Releases page.
170+
# --generate-notes: appends a changelog built from merged PRs since
171+
# the previous release (full history for the first one).
172+
gh release create "$VER" \
173+
--draft \
174+
--generate-notes \
175+
--target "$GITHUB_SHA" \
176+
--title "$VER" \
177+
--notes-file "$NOTES" \
178+
$PRE \
179+
"$LINUX_ASSET" "$WIN_ASSET"

README.md

Lines changed: 20 additions & 2 deletions
7.5 KB
Binary file not shown.
0 Bytes
Binary file not shown.
17.5 KB
Binary file not shown.
0 Bytes
Binary file not shown.
14 KB
Binary file not shown.
0 Bytes
Binary file not shown.
-1 KB
Binary file not shown.

0 commit comments

Comments
 (0)