Skip to content

Commit 0b3710e

Browse files
wilgdavidmfinolwebbertakken
authored
Fix support for Windows and macOS (#44)
* mac support? * i dont know bash! * bash my head in * hm * boy i don't know bash * i really really don't know bash * fuck around * idk * reset all * I DONT KNOW * Update action.yml * fewahiufweiu * error messages * oops * probably noy * neat * content root * runner os change Co-authored-by: David Finol <[email protected]> * mkdir -p * typo * Update steam_deploy.sh * Fix two invalid comparison operators Co-authored-by: David Finol <[email protected]> Co-authored-by: Webber Takken <[email protected]>
1 parent 919dd88 commit 0b3710e

File tree

2 files changed

+30
-25
lines changed

2 files changed

+30
-25
lines changed

action.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ runs:
7878
env:
7979
STEAM_HOME: ${{ steps.setup-steamcmd.outputs.directory }}
8080
STEAM_CMD: ${{ steps.setup-steamcmd.outputs.executable }}
81-
username: ${{ inputs.username }}
82-
password: ${{ inputs.password }}
81+
steam_username: ${{ inputs.username }}
82+
steam_password: ${{ inputs.password }}
8383
configVdf: ${{ inputs.configVdf }}
8484
ssfnFileName: ${{ inputs.ssfnFileName }}
8585
ssfnFileContents: ${{ inputs.ssfnFileContents }}
@@ -98,7 +98,7 @@ runs:
9898
depot9Path: ${{ inputs.depot9Path }}
9999
releaseBranch: ${{ inputs.releaseBranch }}
100100
run: |
101-
chmod +x ${{ github.action_path }}/steam_deploy.sh
102-
${{ github.action_path }}/steam_deploy.sh
101+
chmod +x $GITHUB_ACTION_PATH/steam_deploy.sh
102+
$GITHUB_ACTION_PATH/steam_deploy.sh
103103
echo "::set-output name=manifest::$(pwd)/manifest.vdf"
104104
shell: bash

steam_deploy.sh

100644100755
+26-21
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,27 @@ echo "# Generating App Manifest #"
5454
echo "#################################"
5555
echo ""
5656

57-
mkdir BuildOutput
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
5870

5971
cat << EOF > "manifest.vdf"
6072
"appbuild"
6173
{
6274
"appid" "$appId"
6375
"desc" "$buildDescription"
6476
"buildoutput" "BuildOutput"
65-
"contentroot" "$(pwd)/$rootPath"
77+
"contentroot" "$contentroot"
6678
"setlive" "$releaseBranch"
6779
6880
"depots"
@@ -80,24 +92,17 @@ echo "# Copying SteamGuard Files #"
8092
echo "#################################"
8193
echo ""
8294

83-
mkdir -p "$STEAM_HOME/config"
84-
mkdir -p "/home/runner/Steam/config"
85-
86-
echo "Copying $STEAM_HOME/config/config.vdf..."
87-
echo "$configVdf" > "$STEAM_HOME/config/config.vdf"
88-
chmod 777 "$STEAM_HOME/config/config.vdf"
95+
echo "Steam is installed in: $steamdir"
8996

90-
echo "Copying /home/runner/Steam/config/config.vdf..."
91-
echo "$configVdf" > "/home/runner/Steam/config/config.vdf"
92-
chmod 777 "/home/runner/Steam/config/config.vdf"
97+
mkdir -p "$steamdir/config"
9398

94-
echo "Copying $STEAM_HOME/ssfn..."
95-
echo "$ssfnFileContents" | base64 -d > "$STEAM_HOME/$ssfnFileName"
96-
chmod 777 "$STEAM_HOME/$ssfnFileName"
99+
echo "Copying $steamdir/config/config.vdf..."
100+
echo "$configVdf" | base64 -d > "$steamdir/config/config.vdf"
101+
chmod 777 "$steamdir/config/config.vdf"
97102

98-
echo "Copying /home/runner/Steam/ssfn..."
99-
echo "$ssfnFileContents" | base64 -d > "/home/runner/Steam/$ssfnFileName"
100-
chmod 777 "/home/runner/Steam/$ssfnFileName"
103+
echo "Copying $steamdir/ssfn..."
104+
echo "$ssfnFileContents" | base64 -d > "$steamdir/$ssfnFileName"
105+
chmod 777 "$steamdir/$ssfnFileName"
101106

102107
echo "Finished Copying SteamGuard Files!"
103108
echo ""
@@ -108,7 +113,7 @@ echo "# Uploading build #"
108113
echo "#################################"
109114
echo ""
110115

111-
$STEAM_CMD +login "$username" "$password" +run_app_build $(pwd)/manifest.vdf +quit || (
116+
$STEAM_CMD +login "$steam_username" "$steam_password" +run_app_build $manifest_path +quit || (
112117
echo ""
113118
echo "#################################"
114119
echo "# Errors #"
@@ -122,15 +127,15 @@ $STEAM_CMD +login "$username" "$password" +run_app_build $(pwd)/manifest.vdf +qu
122127
echo ""
123128
echo "Listing logs folder:"
124129
echo ""
125-
ls -Ralph "/home/runner/Steam/logs/"
130+
ls -Ralph "$steamdir/logs/"
126131
echo ""
127132
echo "Displaying error log"
128133
echo ""
129-
cat "/home/runner/Steam/logs/stderr.txt"
134+
cat "$steamdir/logs/stderr.txt"
130135
echo ""
131136
echo "Displaying bootstrapper log"
132137
echo ""
133-
cat "/home/runner/Steam/logs/bootstrap_log.txt"
138+
cat "$steamdir/logs/bootstrap_log.txt"
134139
echo ""
135140
echo "#################################"
136141
echo "# Output #"

0 commit comments

Comments
 (0)