forked from game-ci/steam-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
steam_deploy.sh
executable file
·169 lines (141 loc) · 3.67 KB
/
steam_deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
apt-get update
apt-get install -y git
git config --global --add safe.directory '*'
steamdir=${STEAM_HOME:-$HOME/Steam}
# this is relative to the action
contentroot=$(pwd)/$rootPath
# these are temporary file we create, so in a tmpdir
mkdir BuildOutput
manifest_path=$(pwd)/manifest.vdf
echo ""
echo "#################################"
echo "# Generating Depot Manifests #"
echo "#################################"
echo ""
if [ -n "$firstDepotIdOverride" ]; then
firstDepotId=$firstDepotIdOverride
else
# The first depot ID of a standard Steam app is the app's ID plus one
firstDepotId=$((appId + 1))
fi
echo ""
echo "#################################"
echo "# Generating App Manifest #"
echo "#################################"
echo ""
GIT_SHOW=$(git show --quiet)
cat << EOF > "manifest.vdf"
"appbuild"
{
"appid" "$appId"
"desc" "$buildDescription"
"buildoutput" "BuildOutput"
"contentroot" "$contentroot"
"setlive" "$releaseBranch"
"depots"
{
"$customDepotId" "$customDepot"
}
}
EOF
cat manifest.vdf
echo ""
if [ -n "$steam_totp" ]; then
echo ""
echo "#################################"
echo "# Using SteamGuard TOTP #"
echo "#################################"
echo ""
else
if [ ! -n "$configVdf" ]; then
echo "Config VDF input is missing or incomplete! Cannot proceed."
exit 1
fi
steam_totp="INVALID"
echo ""
echo "#################################"
echo "# Copying SteamGuard Files #"
echo "#################################"
echo ""
echo "Steam is installed in: $steamdir"
mkdir -p "$steamdir/config"
echo "Copying $steamdir/config/config.vdf..."
echo "$configVdf" | base64 -d > "$steamdir/config/config.vdf"
chmod 777 "$steamdir/config/config.vdf"
echo "Finished Copying SteamGuard Files!"
echo ""
fi
echo ""
echo "#################################"
echo "# Test login #"
echo "#################################"
echo ""
steamcmd +set_steam_guard_code "$steam_totp" +login "$steam_username" +quit;
ret=$?
if [ $ret -eq 0 ]; then
echo ""
echo "#################################"
echo "# Successful login #"
echo "#################################"
echo ""
else
echo ""
echo "#################################"
echo "# FAILED login #"
echo "#################################"
echo ""
echo "Exit code: $ret"
exit $ret
fi
echo ""
echo "#################################"
echo "# Uploading build #"
echo "#################################"
echo ""
steamcmd +login "$steam_username" +run_app_build "$manifest_path" +quit || (
echo ""
echo "#################################"
echo "# Errors #"
echo "#################################"
echo ""
echo "Listing current folder and rootpath"
echo ""
ls -alh
echo ""
ls -alh "$rootPath" || true
echo ""
echo "Listing logs folder:"
echo ""
ls -Ralph "$steamdir/logs/"
for f in "$steamdir"/logs/*; do
if [ -e "$f" ]; then
echo "######## $f"
cat "$f"
echo
fi
done
echo ""
echo "Displaying error log"
echo ""
cat "$steamdir/logs/stderr.txt"
echo ""
echo "Displaying bootstrapper log"
echo ""
cat "$steamdir/logs/bootstrap_log.txt"
echo ""
echo "#################################"
echo "# Output #"
echo "#################################"
echo ""
ls -Ralph BuildOutput
for f in BuildOutput/*.log; do
echo "######## $f"
cat "$f"
echo
done
exit 1
)
echo "manifest=${manifest_path}" >> $GITHUB_OUTPUT