Add custom rules to depot
Depot file it's not just folder with a game, it's have much more important rules like FileProperties or FileExclusion how can I add a such options to generated depot?
Good shout!
You'd have to extend the action to support this kind of functionality. This repo is open for everyone to contribute to and makes for a stable central logic that everyone can use.
If I understand correctly, the question can be summarized like this:
How can I customize the Github Actions parameters to add options like
FilePropertiesorFileExclusionto the Steam depot usingsteam-deployaction to support game folders with special configurations?
I'd say it's important to have a good understanding of how github actions work first. Here's a great starting point:
https://docs.github.com/en/actions/creating-actions
The steps required to customize and add FileProperties and FileExclusion inputs to the action should look like this:
-
Add new inputs to your fork's
actions.yml. Would probably look something like this (draft):inputs: ... fileProperties: description: 'Additional file properties to apply.' required: false fileExclusion: description: 'Patterns of files to exclude.' required: false -
Add desired logic to
steam_deploy.sh.Here's an untested draft
#!/bin/bash set -euo pipefail IFS=$'\n\t' steamdir=${STEAM_HOME:-$HOME/Steam} contentroot=$(pwd)/$rootPath mkdir BuildOutput manifest_path=$(pwd)/manifest.vdf echo "" echo "#################################" echo "# Generating Depot Manifests #" echo "#################################" echo "" if [ -n "$firstDepotIdOverride" ]; then firstDepotId=$firstDepotIdOverride else firstDepotId=$((appId + 1)) fi i=1; export DEPOTS="\n " until [ $i -gt 9 ]; do eval "currentDepotPath=\$depot${i}Path" if [ -n "$currentDepotPath" ]; then currentDepot=$((firstDepotId + i - 1)) echo "" echo "Adding depot${currentDepot}.vdf ..." echo "" export DEPOTS="$DEPOTS \"$currentDepot\" \"depot${currentDepot}.vdf\"\n " echo "\"DepotBuildConfig\"" > "depot${currentDepot}.vdf" echo "{" >> "depot${currentDepot}.vdf" echo " \"DepotID\" \"$currentDepot\"" >> "depot${currentDepot}.vdf" echo " \"FileMapping\"" >> "depot${currentDepot}.vdf" echo " {" >> "depot${currentDepot}.vdf" echo " \"LocalPath\" \"./$currentDepotPath/*\"" >> "depot${currentDepot}.vdf" echo " \"DepotPath\" \".\"" >> "depot${currentDepot}.vdf" echo " \"recursive\" \"1\"" >> "depot${currentDepot}.vdf" echo " }" >> "depot${currentDepot}.vdf" # Handling File Exclusions if [ -n "${fileExclusion:-}" ]; then for exclusion in $fileExclusion; do echo " \"FileExclusion\" \"$exclusion\"" >> "depot${currentDepot}.vdf" done fi # Handling File Properties if [ -n "${fileProperties:-}" ]; then echo " \"FileProperties\"" >> "depot${currentDepot}.vdf" echo " {" >> "depot${currentDepot}.vdf" for prop in $fileProperties; do echo " \"$prop\"" >> "depot${currentDepot}.vdf" done echo " }" >> "depot${currentDepot}.vdf" fi echo "}" >> "depot${currentDepot}.vdf" cat depot${currentDepot}.vdf echo "" fi i=$((i+1)) done # ... Rest of the script remains unchanged ... -
Push changes to your fork
-
To test these changes, update your unity project's workflow file to point to your
steam-deployfork. It should look something likeyour_github_username/steam-deploy@master(replacemasterwith your branch or tag where you added the changes).
If you plan to contribute changes back to the repository with a pull-request, make sure you follow the contributing guidelines.
Let us know if you have questions 🙏
Thanks everyone, I have no issue making it in my fork, I just put it here to keep track. I will check @GabLeRoux solution and if it works and usefully I will come back with PR.