diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 991e26f..2602c50 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -34,10 +34,50 @@ jobs: - name: Archive run: | - mv target/x86_64-unknown-linux-gnu/release/hedz_reloaded hedz_reloaded + cp target/x86_64-unknown-linux-gnu/release/hedz_reloaded hedz_reloaded tar -czf steamos.tar.gz hedz_reloaded - uses: actions/upload-artifact@v4 with: name: steamos.tar.gz path: ./steamos.tar.gz + + - name: Copy Binary for SteamOS + run: | + mkdir -p build/steamos/content + cp target/x86_64-unknown-linux-gnu/release/hedz_reloaded build/steamos/content/hedz_reloaded + + - name: Install SteamCMD + run: | + sudo apt-get install lib32gcc-s1 -y + mkdir ~/Steam && cd ~/Steam + curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf - + chmod +x ~/Steam/ + ~/Steam/steamcmd.sh +help +quit + + - name: Steam Auth + env: + STEAM_CONFIG: ${{ secrets.STEAM_CONFIG_VDF_BASE64 }} + STEAM_CONFIG_PATH: ~/Steam/config + run: | + mkdir -p $STEAM_CONFIG_PATH + # Decode the base64 data and save it to the config location + echo "$STEAM_CONFIG" | base64 --decode | gunzip > $STEAM_CONFIG_PATH/config.vdf + # Set proper permissions + chmod 644 $STEAM_CONFIG_PATH/config.vdf + ls -lisah $STEAM_CONFIG_PATH/config.vdf + + - name: Steam deploy + env: + # needs to be fully qualified path for steamcmd to find it + DEPOT: ${{ github.workspace }}/build/steamos/scripts/hedz.vdf + STEAM_USR: ${{ secrets.STEAM_USR }} + run: | + cd build/steamos + ~/Steam/steamcmd.sh +login $STEAM_USR +run_app_build $DEPOT +quit + + - name: Discord notification + uses: appleboy/discord-action@v1.2.0 + with: + webhook_url: ${{ secrets.DISCORD_WEBHOOK }} + message: New HEDZ-Reloaded alpha version on Steam diff --git a/.gitignore b/.gitignore index f5e26f1..1263fee 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .DS_Store assets/maps/autosave build/steamos/hedz_reloaded +build/steamos/.env diff --git a/build/steamos/.env.tpl b/build/steamos/.env.tpl new file mode 100644 index 0000000..1d0b379 --- /dev/null +++ b/build/steamos/.env.tpl @@ -0,0 +1,2 @@ +STEAM_USR=rustunit +STEAM_PWD={{ op://Employee/Steam/password }} \ No newline at end of file diff --git a/build/steamos/.envrc b/build/steamos/.envrc new file mode 100644 index 0000000..fe7c01a --- /dev/null +++ b/build/steamos/.envrc @@ -0,0 +1 @@ +dotenv diff --git a/build/steamos/README.md b/build/steamos/README.md new file mode 100644 index 0000000..1fbac9b --- /dev/null +++ b/build/steamos/README.md @@ -0,0 +1,30 @@ + +# buildmachine exclusive steam user: + +see https://partner.steamgames.com/doc/sdk/uploading#Build_Account + +# buildmachine auth key + +go on a linux x86 machine: + +``` +mkdir ~/Steam && cd ~/Steam +curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf - +chmod +x ~/Steam/ +~/Steam/steamcmd.sh +help +quit +``` + +now we have to login with out ci account: + +``` +~/Steam/steamcmd.sh +login USERNAME +quit +``` + +If succesfull this creates `~/Steam/config/config.vdf`. + +On a mac: +``` +cat config.vdf | gzip | base64 | pbcopy +``` + +The gzipped and base64 encoded file is now in the clipboard and ready to be put into a CI secret. \ No newline at end of file diff --git a/build/steamos/builder_linux/linux32/crashhandler.so b/build/steamos/builder_linux/linux32/crashhandler.so deleted file mode 100644 index 99837ee..0000000 Binary files a/build/steamos/builder_linux/linux32/crashhandler.so and /dev/null differ diff --git a/build/steamos/builder_linux/linux32/libstdc++.so.6 b/build/steamos/builder_linux/linux32/libstdc++.so.6 deleted file mode 100644 index fa12047..0000000 Binary files a/build/steamos/builder_linux/linux32/libstdc++.so.6 and /dev/null differ diff --git a/build/steamos/builder_linux/linux32/steamcmd b/build/steamos/builder_linux/linux32/steamcmd deleted file mode 100644 index 13d6050..0000000 Binary files a/build/steamos/builder_linux/linux32/steamcmd and /dev/null differ diff --git a/build/steamos/builder_linux/linux32/steamerrorreporter b/build/steamos/builder_linux/linux32/steamerrorreporter deleted file mode 100644 index 3ae5201..0000000 Binary files a/build/steamos/builder_linux/linux32/steamerrorreporter and /dev/null differ diff --git a/build/steamos/builder_linux/steamcmd.sh b/build/steamos/builder_linux/steamcmd.sh deleted file mode 100644 index d1a022e..0000000 --- a/build/steamos/builder_linux/steamcmd.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash - -STEAMROOT="$(cd "${0%/*}" && echo $PWD)" -STEAMEXE=`basename "$0" .sh` - -UNAME=`uname` -if [ "$UNAME" == "Linux" ]; then - PLATFORM=linux32 - export LD_LIBRARY_PATH="$STEAMROOT/$PLATFORM:$LD_LIBRARY_PATH" -else # if [ "$UNAME" == "Darwin" ]; then - PLATFORM=osx32 - export DYLD_LIBRARY_PATH="$STEAMROOT/$PLATFORM:$DYLD_LIBRARY_PATH" -fi - -ulimit -n 2048 - -MAGIC_RESTART_EXITCODE=42 - -if [ "$DEBUGGER" == "gdb" ] || [ "$DEBUGGER" == "cgdb" ]; then - ARGSFILE=$(mktemp $USER.steam.gdb.XXXX) - - # Set the LD_PRELOAD varname in the debugger, and unset the global version. - if [ "$LD_PRELOAD" ]; then - echo set env LD_PRELOAD=$LD_PRELOAD >> "$ARGSFILE" - echo show env LD_PRELOAD >> "$ARGSFILE" - unset LD_PRELOAD - fi - - $DEBUGGER -x "$ARGSFILE" "$STEAMROOT/$PLATFORM/$STEAMEXE" "$@" - rm "$ARGSFILE" -else - $DEBUGGER "$STEAMROOT/$PLATFORM/$STEAMEXE" "$@" -fi - -STATUS=$? - -if [ $STATUS -eq $MAGIC_RESTART_EXITCODE ]; then - exec "$0" "$@" -fi -exit $STATUS diff --git a/build/steamos/justfile b/build/steamos/justfile index 5696fc4..afbc894 100644 --- a/build/steamos/justfile +++ b/build/steamos/justfile @@ -1,4 +1,17 @@ -PWD:="" + +direnv: + cat .env.tpl | op inject > .env + direnv allow + +get_conf: + cp ~/Library/Application\ Support/Steam/config/config.vdf config.vdf + +ci_conf_macos: + zip - ~/Library/Application\ Support/Steam/config/config.vdf | base64 > config.vdf_b64 + +login: + ./builder_osx/steamcmd +login $STEAM_USR $STEAM_PWD +quit build: - ./builder_osx/steamcmd +login rustunit {{PWD}} +run_app_build ../scripts/hedz.vdf +quit \ No newline at end of file + ./builder_osx/steamcmd +login $STEAM_USR +run_app_build ../scripts/hedz.vdf +quit + diff --git a/build/steamos/scripts/hedz.vdf b/build/steamos/scripts/hedz.vdf index 3a7fd8b..ecca372 100644 --- a/build/steamos/scripts/hedz.vdf +++ b/build/steamos/scripts/hedz.vdf @@ -5,14 +5,14 @@ "verbose" "1" // spew more build details in console "SetLive" "alpha" - "ContentRoot" "..\content\" // root content folder, relative to location of this file - "BuildOutput" "..\output\" // build output folder for build logs and build cache files + "ContentRoot" "../content" // root content folder, relative to location of this file + "BuildOutput" "../output" // build output folder for build logs and build cache files "Depots" { "1603001" // your DepotID { - "FileExclusion" "*/.DS_Store" + "FileExclusion" "../../../assets/.DS_Store" "FileMapping" {