This page is for plugin library maintainers: libraries that ship Pawn includes and server binaries (.dll / .so) via GitHub releases.
If you’re starting a new library repo (layout, tests, releases), see: Library creator guide (includes + plugins)
To make sampctl automatically download and install your binaries, declare resources in your pawn.json / pawn.yaml.
When installing plugin binaries from a package:
sampctlselects oneresources[]entry by matching:platform(must match the target runtime platform)version(must exactly match the runtimeversionstring)
- If there is no exact version match, it falls back to the first resource where:
platformmatchesversionis empty
So:
- Use
resources[].versionto ship different binaries for different runtimes. resources[].versionis compared as a raw string (no semver parsing).
Each entry in resources is a Resource object:
name(string, required): a regular expression matching the GitHub release asset filename.platform("windows"or"linux", required): target platform.version(string, optional): runtime version string this resource belongs to.archive(bool, optional): whether the asset is an archive (.zipor.tar.gz).includes(string[], optional): directories inside the archive to extract (and treat as include roots).plugins(string[], optional): plugin binaries inside the archive to extract.files(map string->string, optional): extra files to extract from the archive, mapped to destinations relative to the runtime root.
Related advanced field:
extract_ignore_patterns(string[], optional): patterns of files that should not be overwritten during extraction. This is meant for users so they can avoid overwriting their own config files.
{
"entry": "test.pwn",
"output": "test.amx",
"dependencies": ["pawn-lang/samp-stdlib"],
"resources": [
{
"name": "^my-plugin-(.*)\\.zip$",
"platform": "windows",
"archive": true,
"includes": ["pawno/include"],
"plugins": ["plugins/my-plugin.dll"]
},
{
"name": "^my-plugin-(.*)\\.tar\\.gz$",
"platform": "linux",
"archive": true,
"includes": ["pawno/include"],
"plugins": ["plugins/my-plugin.so"]
}
]
}Assume you publish both of these assets:
my-plugin-1.2.3.zip(SA:MP)my-plugin-1.2.3-omp.zip(open.mp)
You can model them as two resources per platform, distinguished by name and version.
{
"resources": [
{
"name": "^my-plugin-(.*)\\.zip$",
"platform": "windows",
"version": "0.3.7",
"archive": true,
"plugins": ["plugins/my-plugin.dll"],
"includes": ["pawno/include"]
},
{
"name": "^my-plugin-(.*)-omp\\.zip$",
"platform": "windows",
"version": "v1.2.0-openmp",
"archive": true,
"plugins": ["components/my-plugin.dll"],
"includes": ["pawno/include"]
}
]
}Notes:
- Resource selection uses
runtime.versionandplatform.runtime_typehas no effect. - open.mp detection is based on the runtime
versionstring containingopenmporopen.mp. - The
pluginspaths refer to files inside the archive.sampctlextracts them into the correct runtime folder.
If your plugin needs extra DLLs/SOs:
{
"resources": [
{
"name": "^my-plugin-(.*)\\.zip$",
"platform": "windows",
"archive": true,
"plugins": ["plugins/my-plugin.dll"],
"files": {
"deps/libcurl.dll": "libcurl.dll"
}
}
]
}If you extract archives that contain files that might overwrite user files, set:
{
"extract_ignore_patterns": ["server.cfg", "config.json"]
}This will skip overwriting existing matching files during archive extraction.
See also: