Skip to content

Steam Module

Erin Sharp edited this page Apr 8, 2025 · 3 revisions

The Steam module handles various calls to the SteamAPI and SteamCMD.

Requirements

  • SteamCMD
  • SteamCMD-2FA
    • This generates Steam Guard codes in a headless environment via the CLI. As such, this means it is less secure as you need to extract the Steam Guard seed, meaning anybody with the seed can generate codes and access your account! It is highly recommended you use a separate account for this, which is added to your Steamworks org with specifically only Publish permissions.

Usage

SteamCMD

Authentication

To authenticate with SteamCMD, you only need to run this once:

# It is recommended that Env Vars be used for these. In our internal scripts, these are set via the GitLab CI variables.
steam = ci.SteamCMD(steam_user, steam_pass, steam_seed)

Uploading game builds

To publish game builds:

return_code, build_id = steam.run_app_build(path_to_vdf, desc_for_build)

SteamAPI

Authentication

To authenticate with the SteamAPI, you only need to run this once. It is recommended a Publisher/Partner key be used, as then various Partner only end points can be used (such as SetBuildLive).

steamapi = ci.SteamAPI(steam_partner_api_key)

SetBuildLive

One caveat with SetBuildLive, is that any PUBLIC branch requires manual intervention via the Steam mobile app to approve the build. This will also happen if an approved user id is supplied to the function, regardless of the branch's private status.

steamapi.set_build_live(steam_app_id, steam_branch, build_id, approver_steam_id=steam_approver_id)

Clone this wiki locally