fix(ci): use vendored-openssl and actions-rust-cross

Two-pronged fix for cross-compilation:

1. git2 with vendored-openssl feature - compiles OpenSSL from source,
   eliminating system dependency issues across all platforms

2. houseabsolute/actions-rust-cross@v1 - dedicated GitHub Action that
   properly handles cross-compilation with Docker containers

Sources:
- https://github.com/rust-lang/git2-rs
- https://github.com/houseabsolute/actions-rust-cross

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Sam Valladares 2026-01-26 02:18:18 -06:00
parent ed2fbe60ee
commit 0bcceab717
2 changed files with 16 additions and 36 deletions

View file

@ -15,62 +15,41 @@ jobs:
fail-fast: false
matrix:
include:
# macOS ARM64 (native on Apple Silicon runners)
# macOS ARM64 (Apple Silicon)
- target: aarch64-apple-darwin
os: macos-latest
# macOS x86_64 (uses older Intel-based runner)
# macOS x86_64 (Intel)
- target: x86_64-apple-darwin
os: macos-13
# Linux x86_64
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
# Linux ARM64 (uses cross for proper cross-compilation)
# Linux ARM64 (uses cross via actions-rust-cross)
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
use_cross: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build binary
uses: houseabsolute/actions-rust-cross@v1
with:
targets: ${{ matrix.target }}
- name: Install cross
if: matrix.use_cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest' && !matrix.use_cross
run: |
sudo apt-get update
sudo apt-get install -y libssl-dev pkg-config
- name: Install dependencies (macOS)
if: startsWith(matrix.os, 'macos')
run: |
brew install openssl@3
echo "OPENSSL_DIR=$(brew --prefix openssl@3)" >> $GITHUB_ENV
- name: Build MCP Server (native)
if: "!matrix.use_cross"
run: |
cargo build --release --package vestige-mcp --target ${{ matrix.target }}
- name: Build MCP Server (cross)
if: matrix.use_cross
run: |
cross build --release --package vestige-mcp --target ${{ matrix.target }}
command: build
target: ${{ matrix.target }}
args: "--locked --release --package vestige-mcp"
strip: true
- name: Package
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/vestige-mcp dist/
cp target/${{ matrix.target }}/release/vestige-mcp dist/ 2>/dev/null || true
cp target/${{ matrix.target }}/release/vestige dist/ 2>/dev/null || true
cd dist && tar czf vestige-mcp-${{ matrix.target }}.tar.gz vestige-mcp vestige 2>/dev/null || tar czf vestige-mcp-${{ matrix.target }}.tar.gz vestige-mcp
cd dist
if [ -f vestige-mcp ]; then
tar czf vestige-mcp-${{ matrix.target }}.tar.gz vestige-mcp vestige 2>/dev/null || tar czf vestige-mcp-${{ matrix.target }}.tar.gz vestige-mcp
fi
- name: Upload artifact
uses: actions/upload-artifact@v4