Skip to content

Commit

Permalink
Publish releases (and prereleases) to Steam (#182)
Browse files Browse the repository at this point in the history
Because Steam does not let us push releases to the main release channel
("Default"), all releases will go to the prerelease channel. Upon
closing a formal version, it should be updated manually in Steam at https://partner.steamgames.com/apps/builds/1634870

To set this up, first, create a new user for Steam with limited
permissions. See
https://partner.steamgames.com/doc/sdk/uploading#Build_Account for
details. Note that multiple users can be created with the same email
address. Do NOT connect this user to the mobile steam guard; it should
only use email based OTPs.

After the user is created, create two github secrets: STEAM_USERNAME and
STEAM_PASSWORD.

Then, download steamcmd locally, and run:

steamcmd +login $STEAM_USERNAME $STEAM_PASSWORD +quit

It will prompt you for a code; check the email associated with the
account and enter the one time password.

After that, three more secrets need to be created. Check the steam
directory (~/Library/Application Support/Steam on Mac, I don't know for
other platforms), and run:

base64 -i config/config.vdf

Store this as STEAM_CONFIG_VDK

Then find the file in that directory named ssfnXXXXXX. Save the file
name to STEAM_SSFN_FILENAME, and the contents (using base64 -i) to
STEAM_SSFN

Then the builds will work!
  • Loading branch information
mikeage authored Oct 20, 2021
1 parent ec6ef7e commit 73a797e
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 11 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,76 @@ jobs:
prerelease: ${{ needs.configuration.outputs.prerelease }}
tag_name: ${{ needs.configuration.outputs.version }}
files: releases/*

publish_steam:
name: Publish Steam Release
needs: [configuration, build]
if: |
github.event_name == 'push' &&
github.repository == 'icosa-gallery/open-brush' &&
(github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/v'))
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true # We don't use LFS, but it adds no time, and leave it here in case we do at some point later
- name: Setup steamcmd
uses: CyberAndrii/[email protected]
- name: Restore steam login config
run: |
mkdir -p /home/runner/Steam/config
echo "${{ secrets.STEAM_CONFIG_VDF}}" | base64 -d - > /home/runner/Steam/config/config.vdf
echo "${{ secrets.STEAM_SSFN }}" | base64 -d - > /home/runner/Steam/${{ secrets.STEAM_SSFN_FILENAME }}
- name: Download Build Artifacts (Windows SteamVR)
uses: actions/download-artifact@v2
with:
name: Windows SteamVR
path: build_windows_steamvr
- name: Download Build Artifacts (Windows SteamVR Experimental)
uses: actions/download-artifact@v2
with:
name: Windows SteamVR Experimental
path: build_windows_steamvr_experimental
- name: Upload Regular Build
run: |
pip install -U j2cli
j2 Support/steam/app.vdf.j2 > build_windows_steamvr/app.vdf
j2 Support/steam/main_depot.vdf.j2 > build_windows_steamvr/main_depot.vdf
cp Support/steam/installscript_win.vdf build_windows_steamvr/
steamcmd +login $STEAM_USERNAME $STEAM_PASSWORD +run_app_build $(pwd)/build_windows_steamvr/app.vdf +quit
env:
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
VERSION: ${{ needs.configuration.outputs.version }}
OPEN_BRUSH_APP_ID: 1634870
OPEN_BRUSH_WINDOWS_DEPOT_ID: 1634871
CHANNEL: prerelease
- name: Upload Experimental Build
run: |
pip install -U j2cli
j2 Support/steam/app.vdf.j2 > build_windows_steamvr_experimental/app.vdf
j2 Support/steam/main_depot.vdf.j2 > build_windows_steamvr_experimental/main_depot.vdf
cp Support/steam/installscript_win.vdf build_windows_steamvr_experimental/
steamcmd +login $STEAM_USERNAME $STEAM_PASSWORD +run_app_build $(pwd)/build_windows_steamvr_experimental/app.vdf +quit
env:
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
VERSION: ${{ needs.configuration.outputs.version }}
OPEN_BRUSH_APP_ID: 1634870
OPEN_BRUSH_WINDOWS_DEPOT_ID: 1634871
CHANNEL: prerelease-experimental
- name: Save logs
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: steamcmd logs
path: build_output/


publish_oculus:
name: Publish Oculus Release
needs: [configuration, build]
Expand Down
14 changes: 14 additions & 0 deletions Support/steam/app.vdf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"appbuild"
{
"appid" "{{ OPEN_BRUSH_APP_ID }}"
"Desc" "{{ VERSION }}"
"buildoutput" "../build_output/{{ CHANNEL }}" // Path for steamcmd logs
"contentroot" "." // This file will be copied into the root of the release
"setlive" "{{ CHANNEL }}"
"preview" "0" // For local testing, set this to 1
"local" "" // Not relevant; this is for a custom CDN
"depots"
{
"{{ OPEN_BRUSH_WINDOWS_DEPOT_ID }}" main_depot.vdf
}
}
File renamed without changes.
22 changes: 11 additions & 11 deletions Support/steam/installscript_win.vdf
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,45 @@ InstallScript {
Registry {
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\.tilt" {
string {
"(Default)" "Google.TiltBrush.File"
"(Default)" "Icosa.OpenBrush.File"
}
}
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Google.TiltBrush.File" {
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Icosa.OpenBrush.File" {
string {
"(Default)" "Tilt Brush sketch file"
"(Default)" "Open Brush sketch file"
}
}
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Google.TiltBrush.File\\DefaultIcon" {
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Icosa.OpenBrush.File\\DefaultIcon" {
string {
"(Default)" "%INSTALLDIR%\\TiltBrush.exe"
"(Default)" "%INSTALLDIR%\\OpenBrush.exe"
}
}
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Google.TiltBrush.File\\Shell\\Open\\Command" {
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Icosa.OpenBrush.File\\Shell\\Open\\Command" {
string {
"(Default)" "%WINDIR%\\System32\\WindowsPowershell\\v1.0\\powershell -windowstyle hidden -c \"try { $s=[uri]::EscapeDataString('%1'); (new-object System.Net.WebClient).DownloadString('http://localhost:40074/load?'+$s) } catch { & '%INSTALLDIR%\\TiltBrush.exe' '%1' }\""
"(Default)" "%WINDIR%\\System32\\WindowsPowershell\\v1.0\\powershell -windowstyle hidden -c \"try { $s=[uri]::EscapeDataString('%1'); (new-object System.Net.WebClient).DownloadString('http://localhost:40074/load?'+$s) } catch { & '%INSTALLDIR%\\OpenBrush.exe' '%1' }\""
}
}
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\tiltbrush" {
string {
"(Default)" "URL:Tilt Brush"
"(Default)" "URL:Open Brush"
}
string {
"URL Protocol" ""
}
}
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\tiltbrush\\DefaultIcon" {
string {
"(Default)" "%INSTALLDIR%\\TiltBrush.exe"
"(Default)" "%INSTALLDIR%\\OpenBrush.exe"
}
}
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\tiltbrush\\Shell\\Open\\Command" {
string {
"(Default)" "%WINDIR%\\System32\\WindowsPowershell\\v1.0\\powershell -windowstyle hidden -c \"try { $s=[uri]::EscapeDataString('%1'); (new-object System.Net.WebClient).DownloadString('http://localhost:40074/load?'+$s) } catch { & '%INSTALLDIR%\\TiltBrush.exe' '%1' }\""
"(Default)" "%WINDIR%\\System32\\WindowsPowershell\\v1.0\\powershell -windowstyle hidden -c \"try { $s=[uri]::EscapeDataString('%1'); (new-object System.Net.WebClient).DownloadString('http://localhost:40074/load?'+$s) } catch { & '%INSTALLDIR%\\OpenBrush.exe' '%1' }\""
}
}
}

Firewall {
"Tilt Brush" "%INSTALLDIR%\\TiltBrush.exe"
"Open Brush" "%INSTALLDIR%\\OpenBrush.exe"
}
}
32 changes: 32 additions & 0 deletions Support/steam/main_depot.vdf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"DepotBuildConfig"
{
// # Set your assigned depot ID here
"DepotID" "{{ OPEN_BRUSH_WINDOWS_DEPOT_ID }}"

"ContentRoot" "StandaloneWindows64-SteamVR"

"FileMapping"
{
// Include all files in the build output directory (ContentRoot)
"LocalPath" "*"

// Destination is the main install directory
"DepotPath" "."

// If LocalPath contains wildcards, setting this means that all
// matching files within subdirectories of LocalPath will also
// be included.
"recursive" "1"
}

// Install scripts
"FileMapping" {
"LocalPath" "../installscript_win.vdf"
"DepotPath" "."
}
"InstallScript" "../installscript_win.vdf"

// but exclude all symbol files
"FileExclusion" "*.pdb"
"FileExclusion" "build_log.txt"
}
File renamed without changes.

0 comments on commit 73a797e

Please sign in to comment.