Add linux support in SystemArchitecture.set(), add Dockerfile's in ex… #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Rust Crate for macOS | |
on: | |
push: | |
branches: | |
- kendall/build-both-macs | |
jobs: | |
build-intel: | |
runs-on: macos-13 | |
name: Build on Intel (x86) macOS | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust | |
run: rustup toolchain install stable | |
- name: Set Target | |
run: rustup target add x86_64-apple-darwin | |
- name: Build | |
run: cargo build --target x86_64-apple-darwin -p tbdex_uniffi --release | |
- name: Upload .dylib | |
uses: actions/upload-artifact@v3 | |
with: | |
name: intel-build-dylib | |
path: target/x86_64-apple-darwin/release/libtbdex_uniffi.dylib | |
build-apple-silicon: | |
runs-on: macos-latest | |
name: Build on Apple Silicon (ARM) macOS | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust | |
run: rustup toolchain install stable | |
- name: Build | |
run: cargo build -p tbdex_uniffi --release | |
- name: Upload .dylib | |
uses: actions/upload-artifact@v3 | |
with: | |
name: apple-silicon-build-dylib | |
path: target/release/libtbdex_uniffi.dylib | |
build-ubuntu: | |
runs-on: ubuntu-latest | |
name: Build on Ubuntu (AMD64) | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust | |
run: rustup toolchain install stable | |
- name: Set Target | |
run: rustup target add x86_64-unknown-linux-gnu | |
- name: Install Dependencies | |
run: sudo apt-get update && sudo apt-get install -y build-essential | |
- name: Build | |
run: cargo build --target x86_64-unknown-linux-gnu -p tbdex_uniffi --release | |
- name: Upload .so | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ubuntu-build-so | |
path: target/x86_64-unknown-linux-gnu/release/libtbdex_uniffi.so | |
build-alpine: | |
runs-on: ubuntu-latest | |
name: Build on Alpine (AMD64) | |
container: alpine:latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Dependencies | |
run: | | |
apk add --no-cache \ | |
build-base \ | |
cmake \ | |
pkgconfig \ | |
openssl-dev \ | |
curl \ | |
wget \ | |
git \ | |
ca-certificates \ | |
linux-headers \ | |
perl \ | |
coreutils | |
- name: Install Rust | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
export PATH="$HOME/.cargo/bin:$PATH" | |
rustup default 1.78.0 | |
rustup target add x86_64-unknown-linux-musl | |
- name: Build | |
run: | | |
export PATH="$HOME/.cargo/bin:$PATH" | |
export OPENSSL_DIR=/usr | |
export OPENSSL_LIB_DIR=/usr/lib | |
export OPENSSL_INCLUDE_DIR=/usr/include | |
export PKG_CONFIG_PATH=/usr/lib/pkgconfig | |
RUSTFLAGS="-C target-feature=-crt-static" cargo build --release --target x86_64-unknown-linux-musl -p tbdex_uniffi | |
- name: Upload .so | |
uses: actions/upload-artifact@v3 | |
with: | |
name: alpine-build-so | |
path: target/x86_64-unknown-linux-musl/release/libtbdex_uniffi.so |