steamos CD deployment (#8)

This commit is contained in:
extrawurst
2025-03-20 17:47:15 +01:00
committed by GitHub
parent 77ca2f4ffb
commit 1721a34249
12 changed files with 93 additions and 46 deletions

View File

@@ -34,10 +34,50 @@ jobs:
- name: Archive - name: Archive
run: | 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 tar -czf steamos.tar.gz hedz_reloaded
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
name: steamos.tar.gz name: steamos.tar.gz
path: ./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

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@
.DS_Store .DS_Store
assets/maps/autosave assets/maps/autosave
build/steamos/hedz_reloaded build/steamos/hedz_reloaded
build/steamos/.env

2
build/steamos/.env.tpl Normal file
View File

@@ -0,0 +1,2 @@
STEAM_USR=rustunit
STEAM_PWD={{ op://Employee/Steam/password }}

1
build/steamos/.envrc Normal file
View File

@@ -0,0 +1 @@
dotenv

30
build/steamos/README.md Normal file
View File

@@ -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.

View File

@@ -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

View File

@@ -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: build:
./builder_osx/steamcmd +login rustunit {{PWD}} +run_app_build ../scripts/hedz.vdf +quit ./builder_osx/steamcmd +login $STEAM_USR +run_app_build ../scripts/hedz.vdf +quit

View File

@@ -5,14 +5,14 @@
"verbose" "1" // spew more build details in console "verbose" "1" // spew more build details in console
"SetLive" "alpha" "SetLive" "alpha"
"ContentRoot" "..\content\" // root content folder, relative to location of this file "ContentRoot" "../content" // root content folder, relative to location of this file
"BuildOutput" "..\output\" // build output folder for build logs and build cache files "BuildOutput" "../output" // build output folder for build logs and build cache files
"Depots" "Depots"
{ {
"1603001" // your DepotID "1603001" // your DepotID
{ {
"FileExclusion" "*/.DS_Store" "FileExclusion" "../../../assets/.DS_Store"
"FileMapping" "FileMapping"
{ {