Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 178 additions & 0 deletions .github/workflows/shring-outbreak-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
name: Build Shring Outbreak Pterodactyl ZIP

on:
push:
branches:
- shring-outbreak-build
paths:
- "shring-outbreak-builder/**"
- ".github/workflows/shring-outbreak-build.yml"
workflow_dispatch:

permissions:
contents: read

env:
UPSTREAM_COMMIT: 85df5067b19a876cac4304232cc1e68ff1b07c7f
RELEASE_VERSION: 1.1.0
PUBLIC_URL: https://shootup.shring.net

jobs:
build:
name: Build, smoke test, and package
runs-on: ubuntu-24.04
timeout-minutes: 45

steps:
- name: Check out build pipeline
uses: actions/checkout@v4

- name: Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14

- name: Download pinned Suroi source
shell: bash
run: |
set -euo pipefail
mkdir -p work/suroi
curl --fail --location --retry 4 --retry-delay 3 \
--output work/suroi.tar.gz \
"https://github.com/HasangerGames/suroi/archive/${UPSTREAM_COMMIT}.tar.gz"
tar -xzf work/suroi.tar.gz --strip-components=1 -C work/suroi
test -f work/suroi/package.json

- name: Apply Shring changes
run: node shring-outbreak-builder/apply-patches.mjs work/suroi "$PUBLIC_URL"

- name: Install build dependencies
working-directory: work/suroi
run: bun install --frozen-lockfile

- name: Build production browser client
working-directory: work/suroi
env:
NODE_ENV: production
run: bun run build:client

- name: Validate compiled client
shell: bash
run: |
set -euo pipefail
test -s work/suroi/client/dist/index.html
test -d work/suroi/client/dist/assets
grep -q "Shring Outbreak" work/suroi/client/dist/index.html
! grep -q "127.0.0.1:8000" work/suroi/client/dist/assets/*.js

- name: Install production-only dependencies
shell: bash
working-directory: work/suroi
run: |
set -euo pipefail
rm -rf node_modules client/node_modules common/node_modules server/node_modules tests/node_modules
bun install --production --frozen-lockfile
test -d node_modules
du -sh node_modules client/dist

- name: Assemble flat Pterodactyl package
shell: bash
run: |
set -euo pipefail
PACKAGE="$GITHUB_WORKSPACE/work/package"
mkdir -p "$PACKAGE/bin" "$PACKAGE/suroi"
rsync -a --delete \
--exclude '.git' \
--exclude '.github' \
--exclude 'tests' \
"$GITHUB_WORKSPACE/work/suroi/" "$PACKAGE/suroi/"
cp "$(command -v bun)" "$PACKAGE/bin/bun"
cp shring-outbreak-builder/runtime/gateway.mjs "$PACKAGE/gateway.mjs"
cp shring-outbreak-builder/runtime/start.mjs "$PACKAGE/start.mjs"
cp shring-outbreak-builder/runtime/start.sh "$PACKAGE/start.sh"
cp shring-outbreak-builder/runtime/.env.example "$PACKAGE/.env.example"
cp shring-outbreak-builder/runtime/README-FIRST.md "$PACKAGE/README-FIRST.md"
cp shring-outbreak-builder/runtime/THIRD_PARTY_NOTICES.md "$PACKAGE/THIRD_PARTY_NOTICES.md"
cat > "$PACKAGE/VERSION.json" <<EOF
{
"version": "${RELEASE_VERSION}",
"upstreamCommit": "${UPSTREAM_COMMIT}",
"builtAt": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"publicUrl": "${PUBLIC_URL}",
"guestPlay": true
}
EOF
chmod +x "$PACKAGE/start.sh" "$PACKAGE/bin/bun"
test -x "$PACKAGE/bin/bun"
test -s "$PACKAGE/suroi/client/dist/index.html"
test -d "$PACKAGE/suroi/node_modules"
du -sh "$PACKAGE"

- name: Smoke test packaged server and gateway
shell: bash
working-directory: work/package
run: |
set -euo pipefail
./start.sh > smoke-test.log 2>&1 &
SERVER_PID=$!
cleanup() {
kill -TERM "$SERVER_PID" 2>/dev/null || true
wait "$SERVER_PID" 2>/dev/null || true
}
trap cleanup EXIT

healthy=0
for attempt in $(seq 1 120); do
if curl --fail --silent http://127.0.0.1:31025/health > health.json; then
healthy=1
break
fi
if ! kill -0 "$SERVER_PID" 2>/dev/null; then
cat smoke-test.log
exit 1
fi
sleep 1
done

if [ "$healthy" -ne 1 ]; then
cat smoke-test.log
echo "Health endpoint did not become ready" >&2
exit 1
fi

cat health.json
grep -q '"ok":true' health.json
grep -q '"guestPlay":true' health.json
curl --fail --silent http://127.0.0.1:31025/ | grep -q "Shring Outbreak"
curl --fail --silent http://127.0.0.1:31025/api/serverInfo > server-info.json
curl --fail --silent http://127.0.0.1:31025/api/getGame > game.json
cat server-info.json
cat game.json

- name: Create upload ZIP and checksum
shell: bash
run: |
set -euo pipefail
ZIP="Shring-Outbreak-Suroi-v${RELEASE_VERSION}-PREBUILT-FLAT.zip"
cd work/package
zip -r -6 "$GITHUB_WORKSPACE/$ZIP" .
cd "$GITHUB_WORKSPACE"
sha256sum "$ZIP" > "$ZIP.sha256"
unzip -t "$ZIP"
SIZE=$(stat -c%s "$ZIP")
echo "ZIP size: $SIZE bytes"
if [ "$SIZE" -gt 524288000 ]; then
echo "ZIP exceeds the 500 MB Pterodactyl upload target" >&2
exit 1
fi

- name: Upload Pterodactyl artifact
uses: actions/upload-artifact@v4
with:
name: shring-outbreak-pterodactyl-v1.1.0
path: |
Shring-Outbreak-Suroi-v1.1.0-PREBUILT-FLAT.zip
Shring-Outbreak-Suroi-v1.1.0-PREBUILT-FLAT.zip.sha256
if-no-files-found: error
compression-level: 0
retention-days: 14
51 changes: 51 additions & 0 deletions .github/workflows/shring-outbreak-pr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Shring Outbreak PR artifact

on:
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
paths:
- "shring-outbreak-builder/**"
- ".github/workflows/shring-outbreak-pr-build.yml"
workflow_dispatch:

permissions:
contents: read

env:
UPSTREAM_COMMIT: 85df5067b19a876cac4304232cc1e68ff1b07c7f
RELEASE_VERSION: 1.1.0
PUBLIC_URL: https://shootup.shring.net

jobs:
build:
name: Build verified Pterodactyl ZIP
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- name: Check out build branch
uses: actions/checkout@v4

- name: Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14

- name: Build and smoke test package
shell: bash
run: bash shring-outbreak-builder/build.sh

- name: Upload Pterodactyl artifact
uses: actions/upload-artifact@v4
with:
name: shring-outbreak-pterodactyl-v1.1.0
path: |
Shring-Outbreak-Suroi-v1.1.0-PREBUILT-FLAT.zip
Shring-Outbreak-Suroi-v1.1.0-PREBUILT-FLAT.zip.sha256
if-no-files-found: error
compression-level: 0
retention-days: 14
18 changes: 18 additions & 0 deletions shring-outbreak-builder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Shring Outbreak build pipeline

This directory builds a guest-playable Shring-branded deployment from the GPL-3.0 Suroi source at a pinned upstream commit.

It exists only on the `shring-outbreak-build` branch and does not modify the Void Arena `main` branch.

The GitHub Actions workflow performs all memory-intensive client and sprite compilation on GitHub-hosted runners, smoke-tests the completed runtime, and uploads a flat Pterodactyl ZIP. The Pterodactyl server does not compile the client during startup.

Deployment defaults:

- Public URL: `https://shootup.shring.net`
- Public allocation: `31025`
- Internal Suroi main port: `8000`
- Internal game worker port: `8001`
- Guest play: enabled
- Shring Auth: not required

The resulting package contains the modified source, compiled client, production dependencies, a portable Bun runtime, GPL license, modification notice, single-port gateway, and health endpoint.
Loading
Loading