From 32b53ee2767d2e5a1a346bfa86f87d07656bb17b Mon Sep 17 00:00:00 2001 From: Marco Cadetg Date: Mon, 29 Dec 2025 17:04:13 +0100 Subject: [PATCH] Move FreeBSD builds to separate rustnet-bsd repo (#116) --- .github/workflows/release.yml | 57 ++++++---------------- .github/workflows/test-platform-builds.yml | 34 ------------- INSTALL.md | 4 +- README.md | 2 +- 4 files changed, 18 insertions(+), 79 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 66bd4c9..2447ef8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.github/workflows/test-platform-builds.yml b/.github/workflows/test-platform-builds.yml index 1a7cec3..6408892 100644 --- a/.github/workflows/test-platform-builds.yml +++ b/.github/workflows/test-platform-builds.yml @@ -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 diff --git a/INSTALL.md b/INSTALL.md index 4531e92..39e96ea 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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 diff --git a/README.md b/README.md index aea33a9..0828413 100644 --- a/README.md +++ b/README.md @@ -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