Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This repository contains a single SourcePawn plugin **FixFuncRotating** that fixes issues with `func_rotating` entities in Source engine games. The plugin specifically addresses problems with the `StartForward` and `StopAtStartPos` inputs by using DHooks to detour engine functions and modify entity behavior.

**Target Environment:**
- SourceMod 1.11.0+ (currently targeting 1.11.0-git6917)
- SourceMod 1.12.x
- Source engine games (primarily Counter-Strike series)
- Linux servers (gamedata includes Linux signatures)

Expand All @@ -19,25 +19,22 @@ This repository contains a single SourcePawn plugin **FixFuncRotating** that fix
│ │ └── FixFuncRotating.games.txt # Function signatures for DHooks
│ └── scripting/
│ └── FixFuncRotating.sp # Main plugin source code
├── sourceknight.yaml # Build configuration
└── .gitignore
```

## Build System & CI/CD

### SourceKnight Build Tool
This project uses **SourceKnight** as its build system:
- Configuration: `sourceknight.yaml`
- Automatic dependency management (downloads SourceMod 1.11.0-git6917)
- Compiles `.sp` files to `.smx` plugins
### Native GitHub Actions Build
This project builds with a native GitHub Actions workflow (no external build tool):
- Compiler: `rumblefrog/setup-sp` (SourceMod 1.12.x)
- Compiles `.sp` files to `.smx` plugins via `spcomp`
- Packages plugins with gamedata for distribution

### GitHub Actions Pipeline
The CI/CD pipeline (`.github/workflows/ci.yml`):
1. **Build**: Compiles plugin using SourceKnight action
2. **Package**: Creates distribution with plugins and gamedata
3. **Tag**: Auto-tags builds from main/master branch as "latest"
4. **Release**: Creates GitHub releases with tar.gz packages
1. **Build**: Compiles plugin with `spcomp` and packages plugins + gamedata
2. **Tag**: Auto-tags builds from main/master branch as "latest"
3. **Release**: Creates GitHub releases with tar.gz packages

To trigger builds:
- Push to any branch triggers build
Expand Down Expand Up @@ -140,7 +137,7 @@ Currently only includes Linux signatures - Windows support would require additio
3. Test function address resolution

### Updating SourceMod Version
1. Modify `sourceknight.yaml` dependency version
1. Modify the `version` input for `rumblefrog/setup-sp` in `.github/workflows/ci.yml`
2. Test for any API compatibility issues
3. Update backward compatibility code if needed

Expand All @@ -158,7 +155,7 @@ Currently only includes Linux signatures - Windows support would require additio
## Testing & Validation

### Local Testing
Since SourceKnight isn't available in all environments:
Since a full build toolchain isn't available in all environments:
1. Use a SourceMod development server
2. Load the plugin and test with `func_rotating` entities
3. Verify both StartForward and StopAtStartPos behaviors work correctly
Expand Down
58 changes: 32 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,30 @@ on: [push, pull_request, workflow_dispatch]

jobs:
build:
name: "Build"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
include:
- os: ubuntu-24.04
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Build sourcemod plugin
uses: maxime1907/action-sourceknight@v1

- name: Setup SourcePawn compiler
uses: rumblefrog/setup-sp@v1.3.1
with:
cmd: build
version: "1.12.x"
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build sourcemod plugin
working-directory: addons/sourcemod/scripting
run: |
set -euo pipefail
mkdir -p ../plugins
spcomp -o ../plugins/FixFuncRotating.smx FixFuncRotating.sp

- name: Create package
run: |
mkdir -p /tmp/package
cp -R .sourceknight/package/* /tmp/package
cp -R addons/sourcemod/gamedata /tmp/package/common/addons/sourcemod/
set -euo pipefail
mkdir -p /tmp/package/addons/sourcemod/plugins
cp addons/sourcemod/plugins/*.smx /tmp/package/addons/sourcemod/plugins/
cp -R addons/sourcemod/gamedata /tmp/package/addons/sourcemod/

- name: Upload build archive for test runners
uses: actions/upload-artifact@v7
Expand All @@ -34,29 +38,31 @@ jobs:
tag:
name: Tag
needs: build
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'

- uses: dev-drprasad/delete-tag-and-release@v1.1
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
with:
delete_release: true
tag_name: latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: rickstaa/action-create-tag@v1
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
with:
tag: "latest"
tag: latest
github_token: ${{ secrets.GITHUB_TOKEN }}

release:
name: Release
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
needs: [build, tag]
if: |
always() &&
needs.build.result == 'success' &&
(needs.tag.result == 'success' || needs.tag.result == 'skipped') &&
(startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
steps:
- name: Download artifacts
Expand All @@ -67,25 +73,25 @@ jobs:

- name: Versioning
run: |
set -euo pipefail
version="latest"
if [[ "${{ github.ref_type }}" == 'tag' ]]; then
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`;
if [[ "${{ github.ref_type }}" == "tag" ]]; then
version="${GITHUB_REF_NAME}"
fi
echo "RELEASE_VERSION=$version" >> $GITHUB_ENV
echo "RELEASE_VERSION=$version" >> "$GITHUB_ENV"

- name: Package
run: |
set -euo pipefail
cd artifacts
ls -Rall
tar -czf ../${{ github.event.repository.name }}-${{ env.RELEASE_VERSION }}.tar.gz .
tar -czf "../${{ github.event.repository.name }}-${{ env.RELEASE_VERSION }}.tar.gz" .
cd ..
ls -la *.tar.gz

- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.tar.gz'
file: "*.tar.gz"
tag: ${{ env.RELEASE_VERSION }}
file_glob: true
overwrite: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ release/

*.smx
plugins/
.sourceknight
.venv
18 changes: 0 additions & 18 deletions sourceknight.yaml

This file was deleted.