Skip to content

Commit 79894c0

Browse files
Merge pull request #11 from wowemulation-dev/ci/cross-platform-builds
ci: add cross-platform build workflow and funding settings
2 parents c4d14c9 + a6d7b57 commit 79894c0

File tree

9 files changed

+123
-9
lines changed

9 files changed

+123
-9
lines changed

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
github: danielsreichenbach

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ What actually happened.
2727
## Environment
2828

2929
- OS: [e.g., Ubuntu 22.04, Windows 11, macOS 14]
30-
- Rust version: [e.g., 1.85.0]
30+
- Rust version: [e.g., 1.92.0]
3131
- recast-rs version: [e.g., 0.1.0]
3232
- Feature flags enabled: [e.g., parallel, serialization]
3333

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
- name: Install Rust toolchain with formatting and linting components
144144
uses: dtolnay/rust-toolchain@v1
145145
with:
146-
toolchain: 1.85.0
146+
toolchain: 1.92.0
147147
components: rustfmt, clippy
148148

149149
- name: Cache Rust dependencies
@@ -191,7 +191,7 @@ jobs:
191191
matrix:
192192
include:
193193
- os: ubuntu-latest
194-
rust: 1.85.0
194+
rust: 1.92.0
195195
- os: ubuntu-latest
196196
rust: stable
197197
runs-on: ${{ matrix.os }}
@@ -267,7 +267,7 @@ jobs:
267267
- name: Install Rust toolchain with WASM target
268268
uses: dtolnay/rust-toolchain@v1
269269
with:
270-
toolchain: 1.85.0
270+
toolchain: 1.92.0
271271
targets: wasm32-unknown-unknown
272272

273273
- name: Cache Rust dependencies
@@ -308,7 +308,7 @@ jobs:
308308
- name: Install Rust toolchain for documentation
309309
uses: dtolnay/rust-toolchain@v1
310310
with:
311-
toolchain: 1.85.0
311+
toolchain: 1.92.0
312312

313313
- name: Cache documentation dependencies
314314
uses: Swatinem/rust-cache@v2

.github/workflows/cross-build.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
name: Cross-Platform Build
3+
4+
on:
5+
push:
6+
branches: [main]
7+
8+
pull_request:
9+
branches: [main]
10+
11+
workflow_dispatch:
12+
13+
jobs:
14+
matrix-setup:
15+
name: Setup Build Matrix
16+
runs-on: ubuntu-latest
17+
outputs:
18+
matrix: ${{ steps.set-matrix.outputs.matrix }}
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Generate build matrix for all supported platforms
24+
id: set-matrix
25+
run: |
26+
matrix=$(cat <<EOF
27+
{
28+
"include": [
29+
{"target": "aarch64-apple-darwin", "os": "macos-latest", "cross": false},
30+
{"target": "x86_64-apple-darwin", "os": "macos-latest", "cross": false},
31+
{"target": "aarch64-unknown-linux-gnu", "os": "ubuntu-latest", "cross": true},
32+
{"target": "aarch64-unknown-linux-musl", "os": "ubuntu-latest", "cross": true},
33+
{"target": "armv7-unknown-linux-gnueabihf", "os": "ubuntu-latest", "cross": true},
34+
{"target": "armv7-unknown-linux-musleabihf", "os": "ubuntu-latest", "cross": true},
35+
{"target": "x86_64-pc-windows-gnu", "os": "ubuntu-latest", "cross": true},
36+
{"target": "x86_64-pc-windows-msvc", "os": "windows-latest", "cross": false},
37+
{"target": "x86_64-unknown-linux-gnu", "os": "ubuntu-latest", "cross": false},
38+
{"target": "x86_64-unknown-linux-musl", "os": "ubuntu-latest", "cross": true}
39+
]
40+
}
41+
EOF
42+
)
43+
echo "matrix=$(echo $matrix | jq -c .)" >> $GITHUB_OUTPUT
44+
45+
cross-build:
46+
name: Build ${{ matrix.target }}
47+
needs: matrix-setup
48+
strategy:
49+
fail-fast: false
50+
matrix: ${{ fromJson(needs.matrix-setup.outputs.matrix) }}
51+
runs-on: ${{ matrix.os }}
52+
steps:
53+
- name: Checkout repository
54+
uses: actions/checkout@v4
55+
56+
- name: Install Rust toolchain for ${{ matrix.target }}
57+
uses: dtolnay/rust-toolchain@v1
58+
with:
59+
toolchain: stable
60+
targets: ${{ matrix.target }}
61+
62+
# Ensure target is installed (workaround for cross-compilation on macOS)
63+
- name: Ensure target is installed
64+
run: rustup target add ${{ matrix.target }}
65+
66+
- name: Cache cross-compilation dependencies
67+
uses: Swatinem/rust-cache@v2
68+
with:
69+
shared-key: "cross-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}"
70+
cache-on-failure: true
71+
cache-all-crates: true
72+
save-if: ${{ github.ref == 'refs/heads/main' }}
73+
74+
# Use cross for Linux cross-compilation
75+
- name: Install cross for cross-compilation
76+
if: matrix.cross && matrix.os == 'ubuntu-latest'
77+
run: |
78+
cargo install cross --git https://github.com/cross-rs/cross
79+
80+
# Build with cross
81+
- name: Build with cross for ${{ matrix.target }}
82+
if: matrix.cross
83+
run: |
84+
cross build --target ${{ matrix.target }} --release --bin recast-cli
85+
86+
# Build natively
87+
- name: Build natively for ${{ matrix.target }}
88+
if: '!matrix.cross'
89+
run: |
90+
cargo build --target ${{ matrix.target }} --release --bin recast-cli
91+
92+
# Test build artifacts exist
93+
- name: Verify build artifacts exist
94+
shell: bash
95+
run: |
96+
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
97+
ls -la target/${{ matrix.target }}/release/*.exe || true
98+
else
99+
ls -la target/${{ matrix.target }}/release/recast-cli || true
100+
fi
101+
102+
# Upload artifacts
103+
- name: Upload cross-compilation artifacts for ${{ matrix.target }}
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: build-${{ matrix.target }}
107+
path: |
108+
target/${{ matrix.target }}/release/recast-cli*
109+
if-no-files-found: error

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Initial release. This is a Rust port of [RecastNavigation][recast-cpp].
135135

136136
### Notes
137137

138-
- Rust 2024 edition (requires Rust 1.85+)
138+
- Rust 2024 edition (requires Rust 1.92+)
139139
- Uses glam for vector math (WASM SIMD compatible)
140140
- Uses postcard for binary serialization (no_std compatible)
141141
- WASM compatible (simd128 support via glam)

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resolver = "3"
1313
[workspace.package]
1414
version = "0.1.0"
1515
edition = "2024"
16-
rust-version = "1.85"
16+
rust-version = "1.92"
1717
authors = ["Daniel S. Reichenbach <daniel@kogito.network>"]
1818
license = "MIT OR Apache-2.0"
1919
repository = "https://github.com/wowemulation-dev/recast-rs"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A Rust port of [RecastNavigation](https://github.com/recastnavigation/recastnavigation).
44

55
[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue)](LICENSE-MIT)
6-
[![Rust Version](https://img.shields.io/badge/rust-1.85+-orange.svg)](https://www.rust-lang.org)
6+
[![Rust Version](https://img.shields.io/badge/rust-1.92+-orange.svg)](https://www.rust-lang.org)
77
[![WASM Compatible](https://img.shields.io/badge/WASM-compatible-green.svg)](https://webassembly.org/)
88

99
> **Note**: This port is developed for the [WoW Emulation project][wowemu] and

mise.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tools]
2+
mdbook = "latest"
3+
rust = { version = "1.92.0", profile = "default" }

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "1.85.0"
2+
channel = "1.92.0"
33
components = ["rustfmt", "clippy", "rust-src", "rust-analyzer"]
44
profile = "default"

0 commit comments

Comments
 (0)