Skip to content

Commit 51329f0

Browse files
authored
Use Docker action instead of composite one (#46)
* use docker action instead of composite this makes it more testable locally and it is easier to transfer the sentry file from steam, as you can run steamcmd container locally to get it * cleanup steam deploy * use bash strict mode * print actually useful logs * exit instead of waiting for manual input of steam guard code * fix deprecated set-output command #51
1 parent 1b69c0f commit 51329f0

File tree

3 files changed

+92
-51
lines changed

3 files changed

+92
-51
lines changed

Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM cm2network/steamcmd
2+
3+
ENV STEAM_CMD="$STEAMCMDDIR/steamcmd.sh"
4+
5+
ADD *.sh $STEAMCMDDIR
6+
7+
USER root
8+
RUN chown -vfR root:root $STEAMCMDDIR
9+
10+
CMD "$STEAMCMDDIR/steam_deploy.sh"

action.yml

+23-34
Original file line numberDiff line numberDiff line change
@@ -68,38 +68,27 @@ inputs:
6868
outputs:
6969
manifest:
7070
description: "The path to the generated manifest.vdf"
71-
value: ${{ steps.steam-deploy.outputs.manifest }}
7271
runs:
73-
using: "composite"
74-
steps:
75-
- id: setup-steamcmd
76-
uses: CyberAndrii/setup-steamcmd@v1
77-
- id: steam-deploy
78-
env:
79-
STEAM_HOME: ${{ steps.setup-steamcmd.outputs.directory }}
80-
STEAM_CMD: ${{ steps.setup-steamcmd.outputs.executable }}
81-
steam_username: ${{ inputs.username }}
82-
steam_password: ${{ inputs.password }}
83-
steam_totp: ${{ inputs.totp }}
84-
configVdf: ${{ inputs.configVdf }}
85-
ssfnFileName: ${{ inputs.ssfnFileName }}
86-
ssfnFileContents: ${{ inputs.ssfnFileContents }}
87-
appId: ${{ inputs.appId }}
88-
firstDepotIdOverride: ${{ inputs.firstDepotIdOverride }}
89-
buildDescription: ${{ inputs.buildDescription }}
90-
rootPath: ${{ inputs.rootPath }}
91-
depot1Path: ${{ inputs.depot1Path }}
92-
depot2Path: ${{ inputs.depot2Path }}
93-
depot3Path: ${{ inputs.depot3Path }}
94-
depot4Path: ${{ inputs.depot4Path }}
95-
depot5Path: ${{ inputs.depot5Path }}
96-
depot6Path: ${{ inputs.depot6Path }}
97-
depot7Path: ${{ inputs.depot7Path }}
98-
depot8Path: ${{ inputs.depot8Path }}
99-
depot9Path: ${{ inputs.depot9Path }}
100-
releaseBranch: ${{ inputs.releaseBranch }}
101-
run: |
102-
chmod +x $GITHUB_ACTION_PATH/steam_deploy.sh
103-
$GITHUB_ACTION_PATH/steam_deploy.sh
104-
echo "manifest=$(pwd)/manifest.vdf" >> $GITHUB_OUTPUT
105-
shell: bash
72+
using: "docker"
73+
image: Dockerfile
74+
env:
75+
steam_username: ${{ inputs.username }}
76+
steam_password: ${{ inputs.password }}
77+
steam_totp: ${{ inputs.totp }}
78+
configVdf: ${{ inputs.configVdf }}
79+
ssfnFileName: ${{ inputs.ssfnFileName }}
80+
ssfnFileContents: ${{ inputs.ssfnFileContents }}
81+
appId: ${{ inputs.appId }}
82+
firstDepotIdOverride: ${{ inputs.firstDepotIdOverride }}
83+
buildDescription: ${{ inputs.buildDescription }}
84+
rootPath: ${{ inputs.rootPath }}
85+
depot1Path: ${{ inputs.depot1Path }}
86+
depot2Path: ${{ inputs.depot2Path }}
87+
depot3Path: ${{ inputs.depot3Path }}
88+
depot4Path: ${{ inputs.depot4Path }}
89+
depot5Path: ${{ inputs.depot5Path }}
90+
depot6Path: ${{ inputs.depot6Path }}
91+
depot7Path: ${{ inputs.depot7Path }}
92+
depot8Path: ${{ inputs.depot8Path }}
93+
depot9Path: ${{ inputs.depot9Path }}
94+
releaseBranch: ${{ inputs.releaseBranch }}

steam_deploy.sh

+59-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
#!/bin/sh
1+
#!/bin/bash
2+
set -euo pipefail
3+
IFS=$'\n\t'
4+
5+
steamdir=${STEAM_HOME:-$HOME/Steam}
6+
# this is relative to the action
7+
contentroot=$(pwd)/$rootPath
8+
9+
# these are temporary file we create, so in a tmpdir
10+
mkdir BuildOutput
11+
manifest_path=$(pwd)/manifest.vdf
212

313
echo ""
414
echo "#################################"
@@ -54,20 +64,6 @@ echo "# Generating App Manifest #"
5464
echo "#################################"
5565
echo ""
5666

57-
mkdir -p BuildOutput
58-
59-
steamdir=$STEAM_HOME
60-
manifest_path=$(pwd)/manifest.vdf
61-
contentroot=$(pwd)/$rootPath
62-
if [[ "$OSTYPE" = "darwin"* ]]; then
63-
steamdir="$HOME/Library/Application Support/Steam"
64-
elif [[ "$OSTYPE" = "msys"* ]]; then
65-
manifest_path=$(cygpath -w "$manifest_path")
66-
contentroot=$(cygpath -w "$contentroot")
67-
elif [ "$RUNNER_OS" = "Linux" ]; then
68-
steamdir="/home/runner/Steam"
69-
fi
70-
7167
cat << EOF > "manifest.vdf"
7268
"appbuild"
7369
{
@@ -98,6 +94,8 @@ else
9894
exit 1
9995
fi
10096

97+
steam_totp="INVALID"
98+
10199
echo ""
102100
echo "#################################"
103101
echo "# Copying SteamGuard Files #"
@@ -120,13 +118,39 @@ else
120118
echo ""
121119
fi
122120

121+
echo ""
122+
echo "#################################"
123+
echo "# Test login #"
124+
echo "#################################"
125+
echo ""
126+
127+
$STEAM_CMD +set_steam_guard_code "$steam_totp" +login "$steam_username" "$steam_password" +quit;
128+
129+
ret=$?
130+
if [ $ret -eq 0 ]; then
131+
echo ""
132+
echo "#################################"
133+
echo "# Successful login #"
134+
echo "#################################"
135+
echo ""
136+
else
137+
echo ""
138+
echo "#################################"
139+
echo "# FAILED login #"
140+
echo "#################################"
141+
echo ""
142+
echo "Exit code: $ret"
143+
144+
exit $ret
145+
fi
146+
123147
echo ""
124148
echo "#################################"
125149
echo "# Uploading build #"
126150
echo "#################################"
127151
echo ""
128152

129-
$STEAM_CMD +login "$steam_username" "$steam_password" "$steam_totp" +run_app_build $manifest_path +quit || (
153+
$STEAM_CMD +login "$steam_username" "$steam_password" +quit || (
130154
echo ""
131155
echo "#################################"
132156
echo "# Errors #"
@@ -136,11 +160,20 @@ $STEAM_CMD +login "$steam_username" "$steam_password" "$steam_totp" +run_app_bui
136160
echo ""
137161
ls -alh
138162
echo ""
139-
ls -alh $rootPath
163+
ls -alh "$rootPath" || true
140164
echo ""
141165
echo "Listing logs folder:"
142166
echo ""
143167
ls -Ralph "$steamdir/logs/"
168+
169+
for f in "$steamdir"/logs/*; do
170+
if [ -e "$f" ]; then
171+
echo "######## $f"
172+
cat "$f"
173+
echo
174+
fi
175+
done
176+
144177
echo ""
145178
echo "Displaying error log"
146179
echo ""
@@ -155,5 +188,14 @@ $STEAM_CMD +login "$steam_username" "$steam_password" "$steam_totp" +run_app_bui
155188
echo "#################################"
156189
echo ""
157190
ls -Ralph BuildOutput
191+
192+
for f in BuildOutput/*.log; do
193+
echo "######## $f"
194+
cat "$f"
195+
echo
196+
done
197+
158198
exit 1
159199
)
200+
201+
echo "manifest=${manifest_path}" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)