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
6 changes: 3 additions & 3 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ addons/sourcemod/
- Git for version control

### Build System
- **CI/CD**: GitHub Actions (`.github/workflows/build.yml`)
- **Dependency Management**: sourceknight.yaml
- **Compilation**: `spcomp VIP_Core.sp -E -o ../plugins/VIP_Core.smx -i./include`
- **CI/CD**: GitHub Actions (`.github/workflows/ci.yml`)
- **Dependency Management**: none (no external SourcePawn include dependencies beyond SourceMod itself)
- **Compilation**: `spcomp -i include -o ../plugins/VIP_Core.smx VIP_Core.sp`
Comment on lines +48 to +50

### Local Development Setup
```bash
Expand Down
103 changes: 0 additions & 103 deletions .github/workflows/build.yml

This file was deleted.

98 changes: 98 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: CI

on: [push, pull_request, workflow_dispatch]

jobs:
Comment on lines +3 to +5
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- name: Setup SourcePawn compiler
uses: rumblefrog/setup-sp@v1.3.1
with:
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 -i include -o ../plugins/VIP_Core.smx VIP_Core.sp

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

- name: Upload build archive for test runners
uses: actions/upload-artifact@v7
with:
name: ${{ runner.os }}
path: /tmp/package

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

- name: Delete existing "latest" release and tag
run: |
set -euo pipefail
gh release delete latest --cleanup-tag --yes || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: rickstaa/action-create-tag@v1
with:
tag: latest
github_token: ${{ secrets.GITHUB_TOKEN }}

release:
name: Release
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
uses: actions/download-artifact@v8
with:
name: ${{ runner.os }}
path: artifacts

- name: Versioning
run: |
set -euo pipefail
version="latest"
if [[ "${{ github.ref_type }}" == "tag" ]]; then
version="${GITHUB_REF_NAME}"
fi
echo "RELEASE_VERSION=$version" >> "$GITHUB_ENV"

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

- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
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
@@ -1,4 +1,3 @@
.vscode/
*.smx
.sourceknight
plugins/
18 changes: 0 additions & 18 deletions sourceknight.yaml

This file was deleted.