Skip to content

Commit

Permalink
CI: Upload beta builds as Steam Playtest
Browse files Browse the repository at this point in the history
  • Loading branch information
derrod committed Nov 4, 2022
1 parent 8e2ad8c commit 907daf1
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/steam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ env:
STEAM_NIGHTLY_BRANCH: nightly
STEAM_STABLE_BRANCH: staging
STEAM_BETA_BRANCH: beta_staging
STEAM_PLAYTEST_BRANCH: staging
SEVENZIP_HASH: 5290409e7bbe2f133d0bd7e7482548678157ea2be276b0f9cb440600f4be9a2d

jobs:
Expand Down Expand Up @@ -145,8 +146,14 @@ jobs:
run: |
if [[ '${{ steps.build-info.outputs.type }}' == 'release' || '${{ steps.cache.outputs.cache-hit }}' != 'true' ]]; then
echo "result=true" >> $GITHUB_OUTPUT
if [[ '${{ steps.build-info.outputs.branch }}' == '${{ env.STEAM_BETA_BRANCH }}' ]]; then
echo "result_playtest=true" >> $GITHUB_OUTPUT
else
echo "result_playtest=false" >> $GITHUB_OUTPUT
fi
else
echo "result=false" >> $GITHUB_OUTPUT
echo "result_playtest=false" >> $GITHUB_OUTPUT
fi
- name: Download and prepare builds
Expand Down Expand Up @@ -256,6 +263,26 @@ jobs:
steamcmd +login '${{ secrets.STEAM_USER }}' '${{ secrets.STEAM_PASSWORD }}' '${{ steps.steam-totp.outputs.code }}' +run_app_build "$(pwd)/build.vdf" +quit
echo "::endgroup::"
- name: Generate Steam auth code (Playtest)
if: steps.should-run.outputs.result_playtest == 'true'
id: steam-totp-playtest
uses: CyberAndrii/steam-totp@0fc9e59dc5bbf4368d23d5a33956f104248da31a
with:
shared_secret: ${{ secrets.STEAM_SHARED_SECRET }}

- name: Upload to Steam (Playtest)
if: steps.should-run.outputs.result_playtest == 'true'
run: |
cd steam
echo "::group::Prepare Steam build script"
sed 's/@@DESC@@/${{ steps.build-info.outputs.branch }}-${{ steps.build-info.outputs.desc }}/;s/@@BRANCH@@/${{ env.STEAM_PLAYTEST_BRANCH }}/' ../source/CI/steam/obs_playtest_build.vdf > build_playtest.vdf
echo "Generated file:"
cat build_playtest.vdf
echo "::endgroup::"
echo "::group::Upload to Steam"
steamcmd +login '${{ secrets.STEAM_USER }}' '${{ secrets.STEAM_PASSWORD }}' '${{ steps.steam-totp-playtest.outputs.code }}' +run_app_build "$(pwd)/build_playtest.vdf" +quit
echo "::endgroup::"
- name: Upload Steam build logs
if: steps.should-run.outputs.result == 'true'
uses: actions/upload-artifact@v3
Expand Down
35 changes: 35 additions & 0 deletions CI/steam/obs_playtest_build.vdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"AppBuild"
{
"AppID" "1905640"
"Desc" "github_@@DESC@@"

"ContentRoot" "./"
"BuildOutput" "build/"

"SetLive" "@@BRANCH@@"

"Depots"
{
"1905642" // Windows
{
"ContentRoot" "./steam-windows"
"FileMapping"
{
"LocalPath" "*"
"DepotPath" "."
"recursive" "1"
}
}

"1905641" // Mac
{
"ContentRoot" "./steam-macos"
"FileMapping"
{
"LocalPath" "*"
"DepotPath" "."
"recursive" "1"
}
}
}
}

0 comments on commit 907daf1

Please sign in to comment.