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
60 changes: 52 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,20 @@ jobs:
toolchain: stable
targets: i686-unknown-linux-gnu

- name: Install i386 deps
- name: Install build deps
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y build-essential g++-multilib
sudo apt-get install -y build-essential cmake git g++-multilib

- name: Checkout open.mp
uses: actions/checkout@v4
with:
repository: openmultiplayer/open.mp
path: open.mp

- name: Checkout open.mp SDK submodules
run: git -C open.mp submodule update --init --recursive SDK lib/pawn

- name: Cache cargo registry
uses: actions/cache@v4
Expand All @@ -56,12 +65,25 @@ jobs:
- name: Build server plugin
run: |
cargo build --package server --release --target i686-unknown-linux-gnu
strip -s target/i686-unknown-linux-gnu/release/libserver.so -o stripped.so
strip -s target/i686-unknown-linux-gnu/release/libserver.so -o cef-samp.so

- uses: actions/upload-artifact@v4
with:
name: cef-${{ matrix.os }}.so
path: stripped.so
path: cef-samp.so

- name: Build open.mp component
run: |
scripts/build-openmp-component.sh \
--openmp-root "$GITHUB_WORKSPACE/open.mp" \
--build-dir "$GITHUB_WORKSPACE/target/openmp-component-build-${{ matrix.os }}" \
--jobs 2
strip -s "target/openmp-component-build-${{ matrix.os }}/cef.so" -o cef-openmp.so

- uses: actions/upload-artifact@v4
with:
name: cef-openmp-${{ matrix.os }}.so
path: cef-openmp.so

build_server_debian:
runs-on: ubuntu-latest
Expand All @@ -71,11 +93,11 @@ jobs:
os: [12, 13]

steps:
- name: Install i386 deps
- name: Install build deps
run: |
dpkg --add-architecture i386
apt-get update
apt-get install -y build-essential curl make g++-multilib
apt-get install -y build-essential ca-certificates cmake curl git make g++-multilib

- name: Install stable + i686 target
uses: dtolnay/rust-toolchain@master
Expand All @@ -85,6 +107,15 @@ jobs:

- uses: actions/checkout@v4

- name: Checkout open.mp
uses: actions/checkout@v4
with:
repository: openmultiplayer/open.mp
path: open.mp

- name: Checkout open.mp SDK submodules
run: git -C open.mp submodule update --init --recursive SDK lib/pawn

- name: Cache cargo registry
uses: actions/cache@v4
with:
Expand All @@ -109,12 +140,25 @@ jobs:
- name: Build server plugin
run: |
cargo build --package server --release --target i686-unknown-linux-gnu
strip -s target/i686-unknown-linux-gnu/release/libserver.so -o stripped.so
strip -s target/i686-unknown-linux-gnu/release/libserver.so -o cef-samp.so

- uses: actions/upload-artifact@v4
with:
name: cef-debian-${{ matrix.os }}.so
path: stripped.so
path: cef-samp.so

- name: Build open.mp component
run: |
scripts/build-openmp-component.sh \
--openmp-root "$GITHUB_WORKSPACE/open.mp" \
--build-dir "$GITHUB_WORKSPACE/target/openmp-component-build-debian-${{ matrix.os }}" \
--jobs 2
strip -s "target/openmp-component-build-debian-${{ matrix.os }}/cef.so" -o cef-openmp.so

- uses: actions/upload-artifact@v4
with:
name: cef-openmp-debian-${{ matrix.os }}.so
path: cef-openmp.so

build_client:
runs-on: windows-latest
Expand Down
160 changes: 157 additions & 3 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ members = [
"client",
"renderer",
"messages",
"server-core",
"server",
"openmp-component",
"cef-api",
"cef-interface",
"network",
Expand Down
11 changes: 11 additions & 0 deletions docs/build.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Build Notes

## open.mp component
- Default local build: `scripts/build-openmp-component.sh --openmp-root /path/to/open.mp`.
- Build and install into a server: `scripts/build-openmp-component.sh --openmp-root /path/to/open.mp --server-root /path/to/omp-server`.
- Clean rebuild: add `--clean`.

The open.mp checkout path is required through `OPEN_MP_ROOT` or `--openmp-root`.

Installed component artifacts go into `<server>/components`. Load order is `CEF`.

GitHub Actions builds the open.mp component next to the SA:MP server plugin.

## Cross-compiling the Windows client (macOS/Linux)
- Install `cargo-xwin`: `cargo install cargo-xwin --locked`.
- Ensure `XWIN_ACCEPT_LICENSE=1` is set (the script defaults it).
Expand Down
Loading
Loading