From 907daf11f73c867e813ccaabf292524835f0fba7 Mon Sep 17 00:00:00 2001 From: derrod Date: Sat, 8 Oct 2022 09:53:11 +0200 Subject: [PATCH] CI: Upload beta builds as Steam Playtest --- .github/workflows/steam.yml | 27 +++++++++++++++++++++++++ CI/steam/obs_playtest_build.vdf | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 CI/steam/obs_playtest_build.vdf diff --git a/.github/workflows/steam.yml b/.github/workflows/steam.yml index b9f5c6719..ade696adc 100644 --- a/.github/workflows/steam.yml +++ b/.github/workflows/steam.yml @@ -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: @@ -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 @@ -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 diff --git a/CI/steam/obs_playtest_build.vdf b/CI/steam/obs_playtest_build.vdf new file mode 100644 index 000000000..636056094 --- /dev/null +++ b/CI/steam/obs_playtest_build.vdf @@ -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" + } + } + } +}