Skip to content

Commit

Permalink
Upload releases to Steam (#17)
Browse files Browse the repository at this point in the history
(Based heavily on Open Brush, naturally)
  • Loading branch information
mikeage authored Jul 10, 2024
1 parent ccb348f commit 962351b
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -483,3 +483,59 @@ jobs:
target_commitish: ${{ needs.configuration.outputs.currentrelease }}
tag_name: ${{ needs.configuration.outputs.version }}
files: releases/*

publish_steam:
name: Publish Steam Release
needs: [build]
if: |
github.event_name == 'push' &&
github.repository == 'icosa-foundation/open-blocks' &&
(github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/v'))
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
Support/steam
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
md5sum /home/runner/Steam/config/config.vdf
- name: Download Build Artifacts (Windows)
uses: actions/download-artifact@v4
with:
name: Windows
path: build_windows
- name: Upload Build
run: |
pip install -U jinjanator
jinjanate Support/steam/app.vdf.j2 > app.vdf
jinjanate Support/steam/main_depot.win.vdf.j2 > build_windows/main_depot.vdf
#jinjanate Support/steam/installscript_win.vdf.j2 > build_windows_openxr/installscript_win.vdf
steamcmd +login $STEAM_USERNAME +run_app_build $(pwd)/app.vdf +quit
env:
STEAM_USERNAME: ${{ vars.STEAM_USERNAME }}
STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
VERSION: ${{ needs.configuration.outputs.version }}
OPEN_BLOCKS_APP_ID: ${{ vars.STEAM_APP_ID }}
OPEN_BLOCKS_WINDOWS_DEPOT_ID: ${{ vars.STEAM_WINDOWS_DEPOT_ID }}
OPEN_BLOCKS_WINDOWS_EXECUTABLE: ${{ needs.configuration.outputs.basename}}.exe
CHANNEL: beta
- name: Update steam login secret
run: |
base64 -i /home/runner/Steam/config/config.vdf | gh secret set --visibility all --org icosa-foundation STEAM_CONFIG_VDF
md5sum /home/runner/Steam/config/config.vdf
env:
GITHUB_TOKEN: ${{ secrets.SECRET_UPDATER_PAT }}
- name: Save logs
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: steamcmd logs
path: build_output/
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_BLOCKS_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_BLOCKS_WINDOWS_DEPOT_ID }}" build_windows/main_depot.vdf
}
}
32 changes: 32 additions & 0 deletions Support/steam/main_depot.win.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_BLOCKS_WINDOWS_DEPOT_ID }}"

"ContentRoot" "build_windows/StandaloneWindows64"

"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"
}

0 comments on commit 962351b

Please sign in to comment.