Move FreeBSD builds to separate rustnet-bsd repo (#116)

This commit is contained in:
Marco Cadetg
2025-12-29 17:04:13 +01:00
committed by GitHub
parent 8c785e4de7
commit 32b53ee276
4 changed files with 18 additions and 79 deletions

View File

@@ -144,47 +144,6 @@ jobs:
path: ${{ env.ASSET }}
if-no-files-found: error
build-freebsd:
name: build-freebsd
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Build on FreeBSD
uses: vmactions/freebsd-vm@670398e4236735b8b65805c3da44b7a511fb8b27 # v1.3.0
with:
usesh: true
prepare: |
pkg install -y curl libpcap rust
run: |
# Build release binary (without eBPF - not available on FreeBSD)
cargo build --verbose --release --no-default-features
# Create release archive
mkdir -p "rustnet-${{ github.ref_name }}-x86_64-unknown-freebsd"
cp target/release/rustnet "rustnet-${{ github.ref_name }}-x86_64-unknown-freebsd/"
# Copy assets if available
if [ -d "assets" ]; then
mkdir -p "rustnet-${{ github.ref_name }}-x86_64-unknown-freebsd/assets"
cp -r assets/* "rustnet-${{ github.ref_name }}-x86_64-unknown-freebsd/assets/" || true
fi
# Copy documentation
cp README.md "rustnet-${{ github.ref_name }}-x86_64-unknown-freebsd/" || true
cp LICENSE "rustnet-${{ github.ref_name }}-x86_64-unknown-freebsd/" || true
# Create tarball
tar czf "rustnet-${{ github.ref_name }}-x86_64-unknown-freebsd.tar.gz" "rustnet-${{ github.ref_name }}-x86_64-unknown-freebsd"
- name: Upload FreeBSD artifact
uses: actions/upload-artifact@v6
with:
name: build-x86_64-unknown-freebsd
path: rustnet-${{ github.ref_name }}-x86_64-unknown-freebsd.tar.gz
if-no-files-found: error
build-static:
name: build-static-${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
@@ -247,7 +206,7 @@ jobs:
create-release:
name: create-release
runs-on: ubuntu-latest
needs: [build-release, build-freebsd, build-static]
needs: [build-release, build-static]
steps:
- name: Checkout repository
uses: actions/checkout@v6
@@ -312,6 +271,20 @@ jobs:
gh release upload ${{ github.ref_name }} "$artifact" --clobber
done
trigger-bsd-build:
name: trigger-bsd-build
runs-on: ubuntu-latest
needs: create-release
steps:
- name: Trigger FreeBSD build
run: |
gh api repos/domcyrus/rustnet-bsd/dispatches \
-f event_type=freebsd-build \
-f "client_payload[tag]=${{ github.ref_name }}" \
-f "client_payload[rustnet_ref]=${{ github.sha }}"
env:
GH_TOKEN: ${{ secrets.BSD_DISPATCH_TOKEN }}
package-installers:
name: package-installers
runs-on: ubuntu-22.04

View File

@@ -15,7 +15,6 @@ on:
- linux
- macos
- windows
- freebsd
pull_request:
paths:
- 'Cargo.toml'
@@ -155,36 +154,3 @@ jobs:
path: target/i686-pc-windows-msvc/release/rustnet.exe
if-no-files-found: error
build-freebsd:
name: Build FreeBSD (x64)
if: ${{ github.event_name == 'pull_request' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'freebsd' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Build on FreeBSD
uses: vmactions/freebsd-vm@670398e4236735b8b65805c3da44b7a511fb8b27 # v1.3.0
with:
usesh: true
prepare: |
pkg install -y curl libpcap rust
run: |
echo "Building for FreeBSD without default features (no eBPF)"
cargo build --verbose --release --no-default-features
echo "Verifying binary was created"
if [ -f "target/release/rustnet" ]; then
echo "FreeBSD binary successfully built"
ls -lh target/release/rustnet
else
echo "FreeBSD binary not found"
exit 1
fi
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: rustnet-freebsd-x64
path: target/release/rustnet
if-no-files-found: error

View File

@@ -261,11 +261,11 @@ cd /usr/ports/net/rustnet && make install clean
#### From GitHub Releases
Download the FreeBSD binary from [GitHub Releases](https://github.com/domcyrus/rustnet/releases):
Download the FreeBSD binary from the [rustnet-bsd releases](https://github.com/domcyrus/rustnet-bsd/releases):
```bash
# Download the appropriate package
fetch https://github.com/domcyrus/rustnet/releases/download/vX.Y.Z/rustnet-vX.Y.Z-x86_64-unknown-freebsd.tar.gz
fetch https://github.com/domcyrus/rustnet-bsd/releases/download/vX.Y.Z/rustnet-vX.Y.Z-x86_64-unknown-freebsd.tar.gz
# Extract the archive
tar xzf rustnet-vX.Y.Z-x86_64-unknown-freebsd.tar.gz

View File

@@ -120,7 +120,7 @@ choco install rustnet
```
**Other platforms:**
- **FreeBSD**: Download from [GitHub Releases](https://github.com/domcyrus/rustnet/releases)
- **FreeBSD**: Download from [rustnet-bsd releases](https://github.com/domcyrus/rustnet-bsd/releases)
- **Docker, source builds, other Linux distros**: See [INSTALL.md](INSTALL.md) for detailed instructions
### Running RustNet