Add FreeBSD (x86_64, aarch64) support (#3214)
* Add FreeBSD (x86_64, aarch64) support Closes https://github.com/stalwartlabs/stalwart/issues/253 Closes https://github.com/stalwartlabs/stalwart/issues/1736 * Disable FreeBSD aarch64 builds for now
This commit is contained in:
59
.github/workflows/ci.yml
vendored
59
.github/workflows/ci.yml
vendored
@@ -391,6 +391,59 @@ jobs:
|
|||||||
name: artifact-${{matrix.target}}
|
name: artifact-${{matrix.target}}
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
|
||||||
|
freebsd:
|
||||||
|
name: Build / ${{matrix.target}}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 360
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- target: x86_64-unknown-freebsd
|
||||||
|
arch: x86_64
|
||||||
|
# - target: aarch64-unknown-freebsd
|
||||||
|
# arch: aarch64
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6.0.2
|
||||||
|
|
||||||
|
- name: Build in FreeBSD VM
|
||||||
|
uses: vmactions/freebsd-vm@v1
|
||||||
|
with:
|
||||||
|
release: "15.1"
|
||||||
|
arch: ${{matrix.arch}}
|
||||||
|
usesh: true
|
||||||
|
mem: 14336
|
||||||
|
cpu: 4
|
||||||
|
sync: rsync
|
||||||
|
copyback: true
|
||||||
|
# gmake: required by jemalloc-sys on BSD hosts
|
||||||
|
# llvm: provides libclang for bindgen (librocksdb-sys)
|
||||||
|
# rust: libsqlite3-sys 0.38 uses cfg_select!, stabilized in Rust
|
||||||
|
# 1.95. The default 'quarterly' pkg repo still ships rust 1.94, so
|
||||||
|
# switch to the 'latest' repo (currently 1.96.1). rustup is not an
|
||||||
|
# option here: aarch64-unknown-freebsd has no rustup toolchains yet.
|
||||||
|
prepare: |
|
||||||
|
set -e
|
||||||
|
mkdir -p /usr/local/etc/pkg/repos
|
||||||
|
echo 'FreeBSD: { url: "pkg+https://pkg.freebsd.org/${ABI}/latest", mirror_type: "srv" }' > /usr/local/etc/pkg/repos/FreeBSD.conf
|
||||||
|
pkg update -f
|
||||||
|
pkg install -y rust gmake llvm rocksdb
|
||||||
|
rustc --version
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
export CARGO_TARGET_DIR=/tmp/target
|
||||||
|
export CARGO_TERM_COLOR=always
|
||||||
|
cargo build --release -p stalwart --no-default-features --features "sqlite postgres mysql rocks s3 redis azure nats enterprise"
|
||||||
|
mkdir -p artifacts
|
||||||
|
cp /tmp/target/release/stalwart artifacts/stalwart
|
||||||
|
|
||||||
|
- name: Upload Artifacts
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: artifact-${{matrix.target}}
|
||||||
|
path: artifacts
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
permissions:
|
permissions:
|
||||||
@@ -398,7 +451,7 @@ jobs:
|
|||||||
contents: write
|
contents: write
|
||||||
attestations: write
|
attestations: write
|
||||||
if: github.event_name == 'push' || inputs.Release
|
if: github.event_name == 'push' || inputs.Release
|
||||||
needs: [linux, windows, macos]
|
needs: [linux, windows, macos, freebsd]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# Must run before artifacts are downloaded — checkout cleans the workspace.
|
# Must run before artifacts are downloaded — checkout cleans the workspace.
|
||||||
@@ -484,7 +537,7 @@ jobs:
|
|||||||
|
|
||||||
publish:
|
publish:
|
||||||
name: Publish release
|
name: Publish release
|
||||||
needs: [linux, windows, macos, multiarch, release]
|
needs: [linux, windows, macos, freebsd, multiarch, release]
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
@@ -497,7 +550,7 @@ jobs:
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
name: Cleanup failed release
|
name: Cleanup failed release
|
||||||
needs: [linux, windows, macos, multiarch, release]
|
needs: [linux, windows, macos, freebsd, multiarch, release]
|
||||||
if: failure() && startsWith(github.ref, 'refs/tags/')
|
if: failure() && startsWith(github.ref, 'refs/tags/')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
Reference in New Issue
Block a user