Skip to content
Merged
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
76 changes: 76 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: build

# Compile the wolfserve release binary in CI so deployments no longer depend on a
# developer's local toolchain (which caused GLIBC-too-new mismatches against the servers).
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: write # needed to attach binaries to a Release on tag builds

jobs:
build:
# IMPORTANT: build on the OLDEST supported runner so the glibc-linked binary runs on the
# deployment hosts. ubuntu-22.04 ships glibc 2.35; the targets are glibc 2.36 and 2.41, which
# both satisfy the ">= 2.35" floor (glibc is backward-compatible). Do NOT switch to
# ubuntu-latest (24.04 / glibc 2.39) — that binary would FAIL to start on the glibc-2.36
# test/live host with "version `GLIBC_2.39' not found".
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry and target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

# rustls' default backend (aws-lc-rs / aws-lc-sys) builds C sources via CMake.
- name: Install C build tooling for aws-lc-sys
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends cmake clang build-essential

- name: Run tests
run: cargo test --locked

- name: Build release binary
run: cargo build --release --locked --bin wolfserve

- name: Package artifact
run: |
mkdir -p dist
cp target/release/wolfserve dist/wolfserve
strip dist/wolfserve || true
tar -czf wolfserve-x86_64-linux-gnu.tar.gz -C dist wolfserve
echo "Built against:"; ldd --version | head -1
file dist/wolfserve

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: wolfserve-x86_64-linux-gnu
path: |
dist/wolfserve
wolfserve-x86_64-linux-gnu.tar.gz
if-no-files-found: error

- name: Publish release (tag builds only)
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: |
dist/wolfserve
wolfserve-x86_64-linux-gnu.tar.gz
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wolfserve"
version = "0.2.2"
version = "0.3.1"
edition = "2021"
license = "MIT"
description = "A high-performance web server written in Rust that serves PHP applications via FastCGI"
Expand Down Expand Up @@ -33,6 +33,7 @@ rustls-pemfile = "2"
futures-util = "0.3"
hyper-util = { version = "0.1.19", features = ["full"] }
regex = "1"
percent-encoding = "2"
bcrypt = "0.15"
base64 = "0.22"
chrono = { version = "0.4", features = ["serde"] }
Expand Down
11 changes: 10 additions & 1 deletion copyfiles
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Copy source and config files for remote building (avoids GLIBC version errors)
FILES="src wolflib Cargo.toml install_service.sh wolfserve.toml run_bin.sh install.sh build_lib.sh public fix_php_fpm.sh upgrade.sh"
BINARY="target/release/wolfserve"

# Build release binary first
echo "Building release binary..."
cargo build --release

echo "Cleanup remote target to avoid GLIBC conflicts..."
ssh root@100.123.22.10 "rm -rf /mnt/shared/wolfserve/target /mnt/shared/wolfserve/wolflib/target"
Expand All @@ -9,11 +14,15 @@ ssh root@100.83.218.9 "rm -rf /root/mnt/shared/wolfserve/target /root/wolfserve/

echo "Syncing to 100.123.22.10..."
scp -r $FILES root@100.123.22.10:/mnt/shared/wolfserve/
scp $BINARY root@100.123.22.10:/mnt/shared/wolfserve/target/release/wolfserve

echo "Syncing to wolf-grid.com..."
scp -r $FILES root@wolf-grid.com:/root/wolfserve/

echo "Done. You should run 'sh install.sh' on the remote server to compile locally."
echo "Syncing to 100.83.218.9..."
scp -r $FILES root@100.83.218.9:/mnt/shared/wolfserve/
scp $BINARY root@100.83.218.9:/mnt/shared/wolfserve/target/release/wolfserve

echo "Done. Run 'sh install.sh' on remote servers (wolf-grid.com needs local compile due to GLIBC)."


Loading
Loading