Deploy to Steam
This page assumes you are registered as a partner with Steam and that you are familiar with using SteamPipe to upload your builds to Steam.
1. Create a Steam Build Account
Create a specialised builder account that only has access to Edit App Metadata
and
Publish App Changes To Steam
.
See the docs.
2. Add jobs to main.yml
jobs:
buildForWindowsAndLinux:
name: Build for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneWindows64 # Build a Windows 64-bit standalone.
- StandaloneLinux64 # Build a Linux 64-bit standalone.
outputs:
buildVersion: ${{ steps.build.outputs.buildVersion }}
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
lfs: true
- uses: actions/[email protected]
with:
path: Library
key:
Library-${{ matrix.targetPlatform }}-${{ hashFiles('Assets/**', 'Packages/**',
'ProjectSettings/**') }}
restore-keys: |
Library-${{ matrix.targetPlatform }}-
Library-
- uses: game-ci/unity-[email protected]
id: build
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
versioning: Semantic
- uses: actions/upload-[email protected]
with:
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
deployToSteam:
needs: [buildForWindowsAndLinux]
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Download StandaloneWindows64 Artifact
uses: actions/download-[email protected]
with:
name: Build-StandaloneWindows64
path: build/StandaloneWindows64
- name: Download StandaloneLinux64 Artifact
uses: actions/download-[email protected]
with:
name: Build-StandaloneLinux64
path: build/StandaloneLinux64
- uses: game-ci/steam-[email protected]
with:
username: ${{ secrets.STEAM_USERNAME }}
password: ${{ secrets.STEAM_PASSWORD }}
configVdf: ${{ secrets.STEAM_CONFIG_VDF}}
ssfnFileName: ${{ secrets.STEAM_SSFN_FILE_NAME }}
ssfnFileContents: ${{ secrets.STEAM_SSFN_FILE_CONTENTS }}
appId: ${{ secrets.STEAM_APP_ID }}
buildDescription: v${{ needs.buildForWindowsAndLinux.outputs.buildVersion }}
rootPath: build
depot1Path: StandaloneWindows64
depot2Path: StandaloneLinux64
releaseBranch: prerelease
3. Add GitHub Secrets
- STEAM_USERNAME: The username of the Steam Build Account that you created in step 1.
- STEAM_PASSWORD: The password of the Steam Build Account that you created in step 1.
- STEAM_CONFIG_VDF, STEAM_SSFN_FILE_NAME, and STEAM_SSFN_FILE_CONTENTS: See the step "Setup Steam Authentication" below.
- STEAM_APP_ID: The identifier of your app on steam. You can find it on your dashboard.
4. Setup Steam Authentication
Deploying to Steam requires using Multi-Factor Authentication (MFA) through Steam Guard. This means that simply using username and password isn't enough to authenticate with Steam. However, it is possible to go through the MFA process only once by setting up GitHub Secrets for configVdf, ssfnFileName, and ssfnFileContents with these steps:
- Install Valve's offical steamcmd on your local machine. All following steps will also be done on your local machine.
- Try to login with
steamcmd +login <username> <password> +quit
, which may prompt for the MFA code. If so, type in the MFA code that was emailed to your builder account's email address. - Validate that the MFA process is complete by running
steamcmd +login <username> <password> +quit
again. It should not ask for the MFA code again. - The folder from which you run
steamcmd
will now contain an updatedconfig/config.vdf
file. Usecat config/config.vdf | base64 > config_base64.txt
to encode the file. Copy the contents ofconfig_base64.txt
to a GitHub SecretSTEAM_CONFIG_VDF
. - That folder will also contain two files whose names look like
ssfn<numbers>
, but one of them is a hidden file. Find the hidden one, then copy the name of that file to a GitHub SecretSTEAM_SSFN_FILE_NAME
. - Use
cat <ssfnFileName> | base64 > ssfn_base64.txt
to encode the contents of the hidden ssfn file. Copy the contents ofssfn_base64.txt
to a GitHub SecretSTEAM_SSFN_FILE_CONTENTS
.
If your builder account uses MFA through the Steam Guard App, the steam-deploy
app can use a TOTP
instead of the above configuration. Generating a TOTP is outside the scope of this guide, as it is
simpler to follow the above steps.
5. Additional Configuration
You can configure these to better match your use case.
totp
Deploys to Steam using a TOTP. If this is passed, configVdf
, ssfnFileName
, and
ssfnFileContents
are not required.
buildDescription
The identifier for this specific build, which helps you identify it in steam.
It is recommended to use the semantic version of the build for this.
rootPath
The root path to your builds. This is the base of which depots will search your files.
depot[X]Path
Where X is any number between 1 and 9 (inclusive both).
The relative path following your root path for the files to be included in this depot.
If your appId is 125000 then the depots 125001 ... 125009 will be assumed.
firstDepotId
You can use this to override the ID of the first depot in case the IDs do not start as described in depot[X]Path (e.g. for DLCs).
If your firstDepotId is 125000 then, regardless of the used appId, the depots 125000 ... 125008 will be assumed.
releaseBranch
The branch within steam that this build will be automatically put live on.
Note that the default
branch
has been observed to not work as a release
branch, presumably because it is potentially dangerous.