Search Unity

Snippet: Automate Steam upload

Discussion in 'Scripting' started by gumboots, Oct 25, 2019.

  1. gumboots

    gumboots

    Joined:
    May 24, 2011
    Posts:
    298
    Hi all,

    I couldn't find any snippets for this and spent an embarassing amount of time figuring it out, so I thought I'd post it here in case it helps anyone. Below is a method you can use to trigger a Steam upload in your build post-processing:
    Code (CSharp):
    1. static void RunSteamCmd(string username, string appId, string description) {
    2.     string steamCmdPath = @"C:\Game Development\Steam SDK\tools\ContentBuilder\builder\steamcmd.exe";
    3.     string appBuildScriptPath = $@"C:\Game Development\Steam SDK\tools\ContentBuilder\scripts\app_build_{appId}.vdf";
    4.     string arguments = $@"+login {username} +run_app_build -desc ""{description}"" ""{appBuildScriptPath}"" +quit";
    5.  
    6.     System.Diagnostics.Process.Start(steamCmdPath, arguments);
    7. }
    You'll need to tweak the file paths to suit you, you also need to have logged in with a password to steamcmd at least once. But this will start a process, run the build script and then exit.

    Hope it helps someone!
     
    DigitalJim and MariusUrbelis like this.
  2. Le_Jo

    Le_Jo

    Joined:
    Jan 24, 2019
    Posts:
    13
    Hi,

    It's late but I was curious if it was still working ?
    I upload to steam at least once per week and I'm looking for a "1 button" unity tool to automate it :3