Quick way to install plugin dependencies ( includes ). It's mainly meant to be used with Github Actions, but it can be used normally just fine.
Here is one of my repositories that uses this script to compile and release a plugin: AllClassReviveMarker
- Clone the repository.
- Run
rust build
( if you don't have Rust, download it from the official website ). - It's compiled!
Note that the Compile section is not used by the script itself, but it gets used by the github action to compile all the listed plugins.
To add includes, you just need to add:
[[dependency]]
url = "github url to the include folder OR include file"
path = "directory where you want to download the includes. If you just want to download them inside the include folder, just put a ."
Here is an example:
[Compile]
plugins = [
"AllClassReviveMarker",
"test"
]
[[dependency]]
url = "https://github.com/nosoop/stocksoup"
path = "stocksoup"
[[dependency]]
url = "https://github.com/DosMike/tf2hudmsg/blob/master/tf2hudmsg.inc"
path = "."
Just shove this in your workflow and you're good to go.
- name: Download the includes downloader
uses: tsuza/SPDependy@v2
with:
github_token: '${{ secrets.GITHUB_TOKEN }}'
If it's giving you any problems use v1 instead ( tsuza/SPDependy@v1 ) and open an issue.
github_token
- Required.
file_name
- Not required.
- Default value: 'sp.toml'
output_directory
- Not required.
- Default value: '.temp/include/'
If you want an example workflow file, check out the example folder.
NB: Since this will be run on a Linux runner most likely, make sure to have all of your directories ( plugins, include, scripting, gamedata, translations ) lower case.
- Download the latest executable and run it inside the folder where sp.toml resides.
- It's recommended to run it inside the terminal and put your github token after it so you don't run against call request limits. However, you'll be just fine unless you run it like 70 times in 10 minutes
- Implement a Rust-like approach where you can just list the names of the include ( e.g. Stocksoup ) and it'll automatically fetch the URL.
This is my first Rust script. If there are any suggestions or improvements, open an issue!