Skip to content

Commit

Permalink
Fix support for Windows and macOS (#44)
Browse files Browse the repository at this point in the history
* 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 <davidmfinol@gmail.com>

* mkdir -p

* typo

* Update steam_deploy.sh

* Fix two invalid comparison operators

Co-authored-by: David Finol <davidmfinol@gmail.com>
Co-authored-by: Webber Takken <webber.nl@gmail.com>
  • Loading branch information
3 people committed Sep 26, 2022
1 parent 919dd88 commit 0b3710e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
8 changes: 4 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ runs:
env:
STEAM_HOME: ${{ steps.setup-steamcmd.outputs.directory }}
STEAM_CMD: ${{ steps.setup-steamcmd.outputs.executable }}
username: ${{ inputs.username }}
password: ${{ inputs.password }}
steam_username: ${{ inputs.username }}
steam_password: ${{ inputs.password }}
configVdf: ${{ inputs.configVdf }}
ssfnFileName: ${{ inputs.ssfnFileName }}
ssfnFileContents: ${{ inputs.ssfnFileContents }}
Expand All @@ -98,7 +98,7 @@ runs:
depot9Path: ${{ inputs.depot9Path }}
releaseBranch: ${{ inputs.releaseBranch }}
run: |
chmod +x ${{ github.action_path }}/steam_deploy.sh
${{ github.action_path }}/steam_deploy.sh
chmod +x $GITHUB_ACTION_PATH/steam_deploy.sh
$GITHUB_ACTION_PATH/steam_deploy.sh
echo "::set-output name=manifest::$(pwd)/manifest.vdf"
shell: bash
47 changes: 26 additions & 21 deletions steam_deploy.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,27 @@ echo "# Generating App Manifest #"
echo "#################################"
echo ""

mkdir BuildOutput
mkdir -p BuildOutput

steamdir=$STEAM_HOME
manifest_path=$(pwd)/manifest.vdf
contentroot=$(pwd)/$rootPath
if [[ "$OSTYPE" = "darwin"* ]]; then
steamdir="$HOME/Library/Application Support/Steam"
elif [[ "$OSTYPE" = "msys"* ]]; then
manifest_path=$(cygpath -w "$manifest_path")
contentroot=$(cygpath -w "$contentroot")
elif [ "$RUNNER_OS" = "Linux" ]; then
steamdir="/home/runner/Steam"
fi

cat << EOF > "manifest.vdf"
"appbuild"
{
"appid" "$appId"
"desc" "$buildDescription"
"buildoutput" "BuildOutput"
"contentroot" "$(pwd)/$rootPath"
"contentroot" "$contentroot"
"setlive" "$releaseBranch"
"depots"
Expand All @@ -80,24 +92,17 @@ echo "# Copying SteamGuard Files #"
echo "#################################"
echo ""

mkdir -p "$STEAM_HOME/config"
mkdir -p "/home/runner/Steam/config"

echo "Copying $STEAM_HOME/config/config.vdf..."
echo "$configVdf" > "$STEAM_HOME/config/config.vdf"
chmod 777 "$STEAM_HOME/config/config.vdf"
echo "Steam is installed in: $steamdir"

echo "Copying /home/runner/Steam/config/config.vdf..."
echo "$configVdf" > "/home/runner/Steam/config/config.vdf"
chmod 777 "/home/runner/Steam/config/config.vdf"
mkdir -p "$steamdir/config"

echo "Copying $STEAM_HOME/ssfn..."
echo "$ssfnFileContents" | base64 -d > "$STEAM_HOME/$ssfnFileName"
chmod 777 "$STEAM_HOME/$ssfnFileName"
echo "Copying $steamdir/config/config.vdf..."
echo "$configVdf" | base64 -d > "$steamdir/config/config.vdf"
chmod 777 "$steamdir/config/config.vdf"

echo "Copying /home/runner/Steam/ssfn..."
echo "$ssfnFileContents" | base64 -d > "/home/runner/Steam/$ssfnFileName"
chmod 777 "/home/runner/Steam/$ssfnFileName"
echo "Copying $steamdir/ssfn..."
echo "$ssfnFileContents" | base64 -d > "$steamdir/$ssfnFileName"
chmod 777 "$steamdir/$ssfnFileName"

echo "Finished Copying SteamGuard Files!"
echo ""
Expand All @@ -108,7 +113,7 @@ echo "# Uploading build #"
echo "#################################"
echo ""

$STEAM_CMD +login "$username" "$password" +run_app_build $(pwd)/manifest.vdf +quit || (
$STEAM_CMD +login "$steam_username" "$steam_password" +run_app_build $manifest_path +quit || (
echo ""
echo "#################################"
echo "# Errors #"
Expand All @@ -122,15 +127,15 @@ $STEAM_CMD +login "$username" "$password" +run_app_build $(pwd)/manifest.vdf +qu
echo ""
echo "Listing logs folder:"
echo ""
ls -Ralph "/home/runner/Steam/logs/"
ls -Ralph "$steamdir/logs/"
echo ""
echo "Displaying error log"
echo ""
cat "/home/runner/Steam/logs/stderr.txt"
cat "$steamdir/logs/stderr.txt"
echo ""
echo "Displaying bootstrapper log"
echo ""
cat "/home/runner/Steam/logs/bootstrap_log.txt"
cat "$steamdir/logs/bootstrap_log.txt"
echo ""
echo "#################################"
echo "# Output #"
Expand Down

0 comments on commit 0b3710e

Please sign in to comment.