mirror of
https://github.com/rumblefrog/setup-sp.git
synced 2026-10-09 23:19:46 +02:00
96 lines
No EOL
2.4 KiB
Markdown
96 lines
No EOL
2.4 KiB
Markdown
# Setup SourcePawn Action
|
|
|
|

|
|
|
|
This action sets-up, cache and adds sourcemod scripting directory to the path
|
|
|
|
# Usage
|
|
|
|
See [action.yml](https://github.com/rumblefrog/setup-sp/blob/master/action.yml)
|
|
|
|
## Basic:
|
|
|
|
```yaml
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: rumblefrog/setup-sp@master
|
|
with:
|
|
version: '1.12.x'
|
|
|
|
- run: spcomp -iAnotherIncludeDirectory plugin.sp -o output/plugin.smx
|
|
```
|
|
|
|
## Matrix:
|
|
|
|
```yaml
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
sm-version: [ '1.11.x', '1.12.x', '1.11.6467', '>= 1.11.6478']
|
|
|
|
name: SM version ${{ matrix.sm-version }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup SP
|
|
uses: rumblefrog/setup-sp@master
|
|
with:
|
|
version: ${{ matrix.sm-version }}
|
|
|
|
- run: spcomp -iAnotherIncludeDirectory plugin.sp -o output/plugin.smx
|
|
```
|
|
|
|
## Extract the version of the .sp file:
|
|
|
|
```yaml
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
name: SM version ${{ matrix.sm-version }}
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Setup SP
|
|
id: setup_sp
|
|
uses: rumblefrog/setup-sp@master
|
|
with:
|
|
version: '1.10.x'
|
|
version-file: ./plugin.sp
|
|
|
|
- run: |
|
|
spcomp -iAnotherIncludeDirectory plugin.sp -o output/plugin.smx
|
|
echo Plugin version ${{ steps.setup_sp.outputs.plugin-version }}
|
|
```
|
|
|
|
## Using the SourcePawn 1 compatibility compiler:
|
|
|
|
SourceMod builds starting with `1.13.0.7451` bundle SourcePawn 2 as `spcomp`.
|
|
Projects that still require the frozen SourcePawn 1 compiler, such as projects
|
|
using `VFormat`, can opt into the bundled `oldspcomp` compiler:
|
|
|
|
```yaml
|
|
- uses: rumblefrog/setup-sp@master
|
|
with:
|
|
version: '1.13.x'
|
|
use-old-spcomp: true
|
|
```
|
|
|
|
The SourcePawn 2 executables remain available as `spcomp-sourcepawn2` and
|
|
`spcomp64-sourcepawn2` when compatibility mode is enabled.
|
|
|
|
## Using a GitHub token to avoid rate limiting:
|
|
|
|
When fetching recent SourceMod builds (1.13.7305+), the action queries the GitHub releases API. To avoid rate limiting, pass a GitHub token:
|
|
|
|
```yaml
|
|
- uses: rumblefrog/setup-sp@master
|
|
with:
|
|
version: '1.13.x'
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
```
|
|
|
|
A complete workflow example can be found [here](https://github.com/Sarrus1/DiscordWebhookAPI/blob/master/.github/workflows/master.yml). |