mirror of
https://github.com/mayanayza/netvisor.git
synced 2025-12-10 08:24:08 -06:00
chore: update build to include FreeBSD and use musl for RHLinux compatibility
This commit is contained in:
42
.github/workflows/release.yml
vendored
42
.github/workflows/release.yml
vendored
@@ -51,18 +51,35 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# Linux - musl for maximum compatibility
|
||||
- os: ubuntu-latest
|
||||
target: x86_64-unknown-linux-gnu
|
||||
target: x86_64-unknown-linux-musl
|
||||
binary: netvisor-daemon-linux-amd64
|
||||
use_cross: true
|
||||
- os: ubuntu-latest
|
||||
target: aarch64-unknown-linux-gnu
|
||||
target: aarch64-unknown-linux-musl
|
||||
binary: netvisor-daemon-linux-arm64
|
||||
use_cross: true
|
||||
|
||||
# FreeBSD
|
||||
- os: ubuntu-latest
|
||||
target: x86_64-unknown-freebsd
|
||||
binary: netvisor-daemon-freebsd-amd64
|
||||
use_cross: true
|
||||
- os: ubuntu-latest
|
||||
target: aarch64-unknown-freebsd
|
||||
binary: netvisor-daemon-freebsd-arm64
|
||||
use_cross: true
|
||||
|
||||
# macOS - native builds
|
||||
- os: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
binary: netvisor-daemon-darwin-amd64
|
||||
use_cross: false
|
||||
- os: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
binary: netvisor-daemon-darwin-arm64
|
||||
use_cross: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -78,18 +95,15 @@ jobs:
|
||||
workspaces: backend
|
||||
key: ${{ matrix.target }}
|
||||
|
||||
- name: Install cross-compilation tools (Linux ARM64)
|
||||
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-aarch64-linux-gnu
|
||||
- name: Install cross
|
||||
if: matrix.use_cross
|
||||
run: cargo install cross --git https://github.com/cross-rs/cross
|
||||
|
||||
- name: Build daemon
|
||||
working-directory: backend
|
||||
run: |
|
||||
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
|
||||
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
|
||||
cargo build --release --bin daemon --target ${{ matrix.target }}
|
||||
if [ "${{ matrix.use_cross }}" = "true" ]; then
|
||||
cross build --release --bin daemon --target ${{ matrix.target }}
|
||||
else
|
||||
cargo build --release --bin daemon --target ${{ matrix.target }}
|
||||
fi
|
||||
@@ -97,12 +111,8 @@ jobs:
|
||||
|
||||
- name: Prepare binary
|
||||
run: |
|
||||
if [ "${{ matrix.os }}" = "windows-latest" ]; then
|
||||
cp backend/target/${{ matrix.target }}/release/daemon.exe ${{ matrix.binary }}
|
||||
else
|
||||
cp backend/target/${{ matrix.target }}/release/daemon ${{ matrix.binary }}
|
||||
fi
|
||||
chmod +x ${{ matrix.binary }} || true
|
||||
cp backend/target/${{ matrix.target }}/release/daemon ${{ matrix.binary }}
|
||||
chmod +x ${{ matrix.binary }}
|
||||
shell: bash
|
||||
|
||||
- name: Upload binary artifact
|
||||
|
||||
Reference in New Issue
Block a user