Skip to content

Easily download a plugin's includes. Github Actions included as well

Notifications You must be signed in to change notification settings

tsuza/SPDependy

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

SPDependy

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.

Example

Here is one of my repositories that uses this script to compile and release a plugin: AllClassReviveMarker

Requirements to compile the script

  1. Clone the repository.
  2. Run rust build ( if you don't have Rust, download it from the official website ).
  3. It's compiled!

sp.toml

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 = "."

Usage in GitHub Actions

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.

Variables:

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.

Usage outside of GitHub Actions

  1. 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

TO-DO

  • 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.

N.B

This is my first Rust script. If there are any suggestions or improvements, open an issue!