Skip to content

Commit

Permalink
Updates tools (Aurorastation#16781)
Browse files Browse the repository at this point in the history
* Fixes errors when running dependencies.sh outside github
* Adds PreCOmpile/InstallDeps/WatchdogLaunch Script heavilybased on tgs versions
* removes tgui artifacts -> using server side build script instead
* removes librust_g.so -> using server side build script instead
* adds .tgs.yml
* Bump Flyway Version

Co-authored-by: Werner <[email protected]>
  • Loading branch information
Arrow768 and Arrow768 authored Jul 18, 2023
1 parent 17518e6 commit 914eedf
Show file tree
Hide file tree
Showing 15 changed files with 103 additions and 49 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/update_tgui.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: "Build TGUI"
on:
workflow_dispatch:
push:
branches:
- master
paths:
- 'tgui/**'

jobs:
update-tgui:
Expand All @@ -15,7 +10,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 14

- name: Checkout Repository
uses: actions/checkout@v3
Expand All @@ -33,7 +28,7 @@ jobs:
- name: Update TGUI
run: |
tools/bootstrap/node tools/build/build.js tgui
tools/bootstrap/node tools/build/build.js tgui
- name: Commit TGUI
run: |
Expand Down
22 changes: 22 additions & 0 deletions .tgs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file is used by TGS (https://github.com/tgstation/tgstation-server) clients to quickly initialize a server instance for the codebase
# The format isn't documented anywhere but hopefully we never have to change it. If there are questions, contact the TGS maintainer Cyberboss/@Dominion#0444
version: 1
# The BYOND version to use (kept in sync with dependencies.sh by the "TGS Test Suite" CI job)
# Must be interpreted as a string, keep quoted
byond: "514.1588"
# Folders to create in "<instance_path>/Configuration/GameStaticFiles/"
static_files:
# Config directory should be static
- name: config
# This implies the folder should be pre-populated with contents from the repo
# populate: true
# Data directory must be static
- name: data
# String dictionary. The value is the location of the file in the repo to upload to TGS. The key is the name of the file to upload to "<instance_path>/Configuration/EventScripts/"
# This one is for Linux hosted servers
linux_scripts:
PreCompile.sh: tools/tgs_scripts/PreCompile.sh
WatchdogLaunch.sh: tools/tgs_scripts/WatchdogLaunch.sh
InstallDeps.sh: tools/tgs_scripts/InstallDeps.sh
# The security level the game should be run at
security: Trusted
4 changes: 3 additions & 1 deletion dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/bin/sh

if [ -z ${GITHUB_ENV+x} ]; then GITHUB_ENV=/dev/null; fi

export BYOND_MAJOR=514
echo "BYOND_MAJOR=$BYOND_MAJOR" >> "$GITHUB_ENV"
export BYOND_MINOR=1589
echo "BYOND_MINOR=$BYOND_MINOR" >> "$GITHUB_ENV"

export RUST_G_VERSION=v1.2.0+a4
echo "RUST_G_VERSION=$RUST_G_VERSION" >> "$GITHUB_ENV"
export FLYWAY_BUILD=9.9.0
export FLYWAY_BUILD=9.20.1
echo "FLYWAY_BUILD=$FLYWAY_BUILD" >> "$GITHUB_ENV"
export SPACEMAN_DMM_VERSION=suite-1.7.3
echo "SPACEMAN_DMM_VERSION=$SPACEMAN_DMM_VERSION" >> "$GITHUB_ENV"
Expand Down
Binary file removed librust_g.so
Binary file not shown.
2 changes: 0 additions & 2 deletions tgui/public/tgui-panel.bundle.css

This file was deleted.

1 change: 0 additions & 1 deletion tgui/public/tgui-panel.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion tgui/public/tgui-say.bundle.css

This file was deleted.

1 change: 0 additions & 1 deletion tgui/public/tgui-say.bundle.js

This file was deleted.

35 changes: 0 additions & 35 deletions tgui/public/tgui.bundle.css

This file was deleted.

1 change: 0 additions & 1 deletion tgui/public/tgui.bundle.js

This file was deleted.

Binary file removed tools/bootstrap/.cache/node-v14.16.1-x64/node.exe
Binary file not shown.
1 change: 1 addition & 0 deletions tools/bootstrap/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.cache
32 changes: 32 additions & 0 deletions tools/tgs_scripts/InstallDeps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

#find out what we have (+e is important for this)
set +e
has_git="$(command -v git)"
has_curl="$(command -v curl)"
has_cargo="$(command -v ~/.cargo/bin/cargo)"
has_sudo="$(command -v sudo)"
has_pip3="$(command -v pip3)"
set -e
set -x

# apt packages, libssl needed by rust-g but not included in TGS barebones install
if ! ( [ -x "$has_git" ] && [ -x "$has_curl" ] && [ -f "/usr/lib/i386-linux-gnu/libssl.so" ] ); then
echo "Installing apt dependencies..."
if ! [ -x "$has_sudo" ]; then
dpkg --add-architecture i386
apt-get update
apt-get install -y lib32z1 git pkg-config libssl-dev:i386 libssl-dev zlib1g-dev:i386 curl
else
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y lib32z1 git pkg-config libssl-dev:i386 libssl-dev zlib1g-dev:i386 curl
fi
fi

# install cargo if needed
if ! [ -x "$has_cargo" ]; then
echo "Installing rust..."
curl https://sh.rustup.rs -sSf | sh -s -- -y
. ~/.profile
fi

37 changes: 37 additions & 0 deletions tools/tgs_scripts/PreCompile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

./InstallDeps.sh

set -e
set -x

#load dep exports
#need to switch to game dir for Dockerfile weirdness
original_dir=$PWD
cd "$1"
. dependencies.sh
cd "$original_dir"

# update rust-g
if [ ! -d "rust-g" ]; then
echo "Cloning rust-g..."
git clone https://github.com/Aurorastation/rust-g
cd rust-g
~/.cargo/bin/rustup target add i686-unknown-linux-gnu
else
echo "Fetching rust-g..."
cd rust-g
git fetch
~/.cargo/bin/rustup target add i686-unknown-linux-gnu
fi

echo "Deploying rust-g..."
git checkout "$RUST_G_VERSION"
env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --target=i686-unknown-linux-gnu --all-features
mv target/i686-unknown-linux-gnu/release/librust_g.so "$1/librust_g.so"
cd ..

# compile tgui
echo "Compiling tgui..."
cd "$1"
env TG_BOOTSTRAP_CACHE="$original_dir" TG_BOOTSTRAP_NODE_LINUX=1 CBT_BUILD_MODE="TGS" tools/bootstrap/node tools/build/build.js
6 changes: 6 additions & 0 deletions tools/tgs_scripts/WatchdogLaunch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# Special file to ensure all dependencies still exist between server launches.
# Mainly for use by people who abuse docker by modifying the container's system.

./InstallDeps.sh

0 comments on commit 914eedf

Please sign in to comment.