Skip to content

Commit 116ae88

Browse files
committed
Upload releases to Steam
(Based heavily on Open Brush, naturally)
1 parent ccb348f commit 116ae88

File tree

3 files changed

+102
-0
lines changed

3 files changed

+102
-0
lines changed

.github/workflows/build.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,3 +483,59 @@ jobs:
483483
target_commitish: ${{ needs.configuration.outputs.currentrelease }}
484484
tag_name: ${{ needs.configuration.outputs.version }}
485485
files: releases/*
486+
487+
publish_steam:
488+
name: Publish Steam Release
489+
needs: [build]
490+
if: |
491+
github.event_name == 'push' &&
492+
github.repository == 'icosa-foundation/open-brush' &&
493+
(github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/v'))
494+
runs-on: ubuntu-latest
495+
steps:
496+
- name: Checkout repository
497+
uses: actions/checkout@v4
498+
with:
499+
fetch-depth: 0
500+
sparse-checkout: |
501+
Support/steam
502+
lfs: true # We don't use LFS, but it adds no time, and leave it here in case we do at some point later
503+
- name: Setup steamcmd
504+
uses: CyberAndrii/[email protected]
505+
- name: Restore steam login config
506+
run: |
507+
mkdir -p /home/runner/Steam/config
508+
echo "${{ secrets.STEAM_CONFIG_VDF}}" | base64 -d - > /home/runner/Steam/config/config.vdf
509+
md5sum /home/runner/Steam/config/config.vdf
510+
- name: Download Build Artifacts (Windows)
511+
uses: actions/download-artifact@v4
512+
with:
513+
name: Windows
514+
path: build_windows
515+
- name: Upload Build
516+
run: |
517+
pip install -U jinjanator
518+
jinjanate Support/steam/app.vdf.j2 > app.vdf
519+
jinjanate Support/steam/main_depot.win.vdf.j2 > build_windows/main_depot.vdf
520+
#jinjanate Support/steam/installscript_win.vdf.j2 > build_windows_openxr/installscript_win.vdf
521+
steamcmd +login $STEAM_USERNAME +run_app_build $(pwd)/app.vdf +quit
522+
env:
523+
STEAM_USERNAME: ${{ vars.STEAM_USERNAME }}
524+
STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
525+
VERSION: ${{ needs.configuration.outputs.version }}
526+
OPEN_BLOCKS_APP_ID: ${{ vars.STEAM_APP_ID }}
527+
OPEN_BLOCKS_WINDOWS_DEPOT_ID: ${{ vars.STEAM_WINDOWS_DEPOT_ID }}
528+
OPEN_BLOCKS_WINDOWS_EXECUTABLE: ${{ needs.configuration.outputs.basename}}.exe
529+
CHANNEL: beta
530+
- name: Update steam login secret
531+
run: |
532+
base64 -i /home/runner/Steam/config/config.vdf | gh secret set --org icosa-foundation STEAM_CONFIG_VDF
533+
md5sum /home/runner/Steam/config/config.vdf
534+
env:
535+
GITHUB_TOKEN: ${{ secrets.SECRET_UPDATER_PAT }}
536+
- name: Save logs
537+
uses: actions/upload-artifact@v4
538+
if: ${{ failure() }}
539+
with:
540+
name: steamcmd logs
541+
path: build_output/

Support/steam/app.vdf.j2

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"appbuild"
2+
{
3+
"appid" "{{ OPEN_BLOCKS_APP_ID }}"
4+
"Desc" "{{ VERSION }}"
5+
"buildoutput" "build_output/{{ CHANNEL }}" // Path for steamcmd logs
6+
"contentroot" "." // This file will be copied into the root of the release
7+
"setlive" "{{ CHANNEL }}"
8+
"preview" "0" // For local testing, set this to 1
9+
"local" "" // Not relevant; this is for a custom CDN
10+
"depots"
11+
{
12+
"{{ OPEN_BLOCKS_WINDOWS_DEPOT_ID }}" build_windows/main_depot.vdf
13+
}
14+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"DepotBuildConfig"
2+
{
3+
// # Set your assigned depot ID here
4+
"DepotID" "{{ OPEN_BLOCKS_WINDOWS_DEPOT_ID }}"
5+
6+
"ContentRoot" "build_windows/StandaloneWindows64"
7+
8+
"FileMapping"
9+
{
10+
// Include all files in the build output directory (ContentRoot)
11+
"LocalPath" "*"
12+
13+
// Destination is the main install directory
14+
"DepotPath" "."
15+
16+
// If LocalPath contains wildcards, setting this means that all
17+
// matching files within subdirectories of LocalPath will also
18+
// be included.
19+
"recursive" "1"
20+
}
21+
22+
// Install scripts
23+
//"FileMapping" {
24+
// "LocalPath" "../installscript_win.vdf"
25+
// "DepotPath" "."
26+
//}
27+
//"InstallScript" "../installscript_win.vdf"
28+
29+
// but exclude all symbol files
30+
"FileExclusion" "*.pdb"
31+
"FileExclusion" "build_log.txt"
32+
}

0 commit comments

Comments
 (0)