Skip to content

Commit 88a8079

Browse files
committed
first commit
0 parents  commit 88a8079

497 files changed

Lines changed: 134762 additions & 0 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/ci.yml

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
name: build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- "main"
8+
paths:
9+
- "src/**"
10+
- "third_party/**"
11+
pull_request:
12+
paths:
13+
- "src/**"
14+
- "third_party/**"
15+
16+
permissions:
17+
contents: write
18+
19+
jobs:
20+
build:
21+
name: Build Extension (sm${{ matrix.sm_version }}, ${{ matrix.os_short }})
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os:
27+
- ubuntu-latest
28+
- ubuntu-22.04
29+
- windows-latest
30+
sm_version:
31+
- "1.11"
32+
- "latest"
33+
34+
include:
35+
- sm_version: latest
36+
sm_branch: master
37+
38+
- sm_version: "1.11"
39+
sm_branch: "1.11-dev"
40+
41+
- os: windows-latest
42+
os_short: win
43+
44+
- os: ubuntu-latest
45+
os_short: linux
46+
47+
- os: ubuntu-22.04
48+
os_short: linux-ubuntu-22.04
49+
50+
steps:
51+
- name: Prepare env
52+
shell: bash
53+
run: |
54+
echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
55+
56+
- name: Install (Linux)
57+
if: runner.os == 'Linux'
58+
run: |
59+
sudo dpkg --add-architecture i386
60+
sudo apt-get update
61+
sudo apt-get install -y clang g++-multilib
62+
echo "CC=clang" >> $GITHUB_ENV
63+
echo "CXX=clang++" >> $GITHUB_ENV
64+
65+
- name: Getting SourceMod ${{ matrix.sm_version }}
66+
uses: actions/checkout@v4
67+
with:
68+
repository: alliedmodders/sourcemod
69+
ref: ${{ matrix.sm_branch }}
70+
path: sourcemod-${{ matrix.sm_version }}
71+
submodules: recursive
72+
73+
- name: Setting up Python
74+
uses: actions/setup-python@v5
75+
with:
76+
python-version: '3.13'
77+
78+
- name: Getting ambuild
79+
run: |
80+
python -m pip install wheel
81+
pip install git+https://github.com/alliedmodders/ambuild
82+
83+
- name: Getting own repository
84+
uses: actions/checkout@v4
85+
with:
86+
path: extension
87+
submodules: recursive
88+
89+
- uses: microsoft/setup-msbuild@v2
90+
if: runner.os == 'Windows'
91+
with:
92+
msbuild-architecture: x64
93+
vs-version: '15'
94+
95+
- name: Compiling ${{ github.event.repository.name }} files
96+
working-directory: extension
97+
run: |
98+
mkdir build
99+
cd build
100+
python ../configure.py --enable-optimize --sm-path="${{ github.workspace }}/sourcemod-${{ matrix.sm_version }}" --targets=x86,x64
101+
ambuild
102+
103+
- name: Uploading package
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: sm-ext-socket-sm${{ matrix.sm_version }}-${{ matrix.os_short }}-${{ env.GITHUB_SHA_SHORT }}
107+
path: extension/build/package
108+
109+
create-release:
110+
needs: build
111+
runs-on: ubuntu-latest
112+
if: github.event_name == 'push'
113+
114+
steps:
115+
- name: Checkout code
116+
uses: actions/checkout@v4
117+
with:
118+
path: extension
119+
sparse-checkout: |
120+
src/smsdk_config.h
121+
122+
- name: Get version from smsdk_config.h
123+
id: get_version
124+
run: |
125+
VERSION=$(grep '#define SMEXT_CONF_VERSION' extension/src/smsdk_config.h | awk -F '"' '{print $2}')
126+
if [ -z "$VERSION" ]; then
127+
echo "Error: Could not find version in smsdk_config.h"
128+
exit 1
129+
fi
130+
echo "version=$VERSION" >> $GITHUB_OUTPUT
131+
132+
- name: Generate Release Notes
133+
run: echo "${{ github.event.head_commit.message }}" >> release_notes.md
134+
135+
- name: Download all artifacts
136+
uses: actions/download-artifact@v4
137+
with:
138+
path: artifacts
139+
140+
- name: Create Release Archives
141+
run: |
142+
cd artifacts
143+
for dir in sm-ext-socket-*; do
144+
7z a "../${dir}.zip" "./${dir}/"*
145+
done
146+
147+
- name: Update Release
148+
uses: softprops/action-gh-release@v2
149+
with:
150+
tag_name: ${{ steps.get_version.outputs.version }}
151+
name: Release ${{ steps.get_version.outputs.version }}
152+
draft: false
153+
prerelease: false
154+
body_path: release_notes.md
155+
files: |
156+
sm-ext-socket-*.zip
157+
env:
158+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/
2+
.vscode/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "third_party/libuv"]
2+
path = third_party/libuv
3+
url = https://github.com/libuv/libuv.git

0 commit comments

Comments
 (0)