From 0397d5eef068c66c9e0aed42b57a6528b0582c6a Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Fri, 5 Dec 2025 12:20:34 +0100 Subject: [PATCH 01/19] [ci] Add FreeBSD port release job to GitHub Actions Includes scripts for generating FreeBSD port update diff and issue body. --- .github/workflows/release.yml | 15 ++ release_files/freebsd-port-diff.sh | 208 +++++++++++++++++++++++ release_files/freebsd-port-issue-body.sh | 154 +++++++++++++++++ 3 files changed, 377 insertions(+) create mode 100755 release_files/freebsd-port-diff.sh create mode 100755 release_files/freebsd-port-issue-body.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a9bc1b979cb..48bbd16e055 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,21 @@ concurrency: cancel-in-progress: true jobs: + release_freebsd_port: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - run: bash release_files/freebsd-port-diff.sh + - run: bash release_files/freebsd-port-issue-body.sh + - name: upload freebsd port files + uses: actions/upload-artifact@v4 + with: + name: freebsd-port-files + path: | + ./netbird-*-issue.txt + ./netbird-*.diff + retention-days: 30 release: runs-on: ubuntu-latest-m env: diff --git a/release_files/freebsd-port-diff.sh b/release_files/freebsd-port-diff.sh new file mode 100755 index 00000000000..8122ab173df --- /dev/null +++ b/release_files/freebsd-port-diff.sh @@ -0,0 +1,208 @@ +#!/bin/bash +# +# FreeBSD Port Diff Generator for NetBird +# +# This script generates the diff file required for submitting a FreeBSD port update. +# It works on macOS, Linux, and FreeBSD by fetching files from FreeBSD cgit and +# computing checksums from the Go module proxy. +# +# Usage: ./freebsd-port-diff.sh [new_version] +# Example: ./freebsd-port-diff.sh 0.60.7 +# +# If no version is provided, it fetches the latest from GitHub. + +set -e + +GITHUB_REPO="netbirdio/netbird" +PORTS_CGIT_BASE="https://cgit.freebsd.org/ports/plain/security/netbird" +GO_PROXY="https://proxy.golang.org/github.com/netbirdio/netbird/@v" +OUTPUT_DIR="${OUTPUT_DIR:-.}" + +fetch_all_tags() { + curl -sL "https://github.com/${GITHUB_REPO}/tags" 2>/dev/null | \ + grep -oE '/releases/tag/v[0-9]+\.[0-9]+\.[0-9]+' | \ + sed 's/.*\/v//' | \ + sort -u -V +} + +fetch_current_ports_version() { + echo "Fetching current version from FreeBSD ports..." >&2 + curl -sL "${PORTS_CGIT_BASE}/Makefile" 2>/dev/null | \ + grep -E "^DISTVERSION=" | \ + sed 's/DISTVERSION=[[:space:]]*//' | \ + tr -d '\t ' +} + +fetch_latest_github_release() { + echo "Fetching latest release from GitHub..." >&2 + fetch_all_tags | tail -1 +} + +fetch_ports_file() { + local filename="$1" + curl -sL "${PORTS_CGIT_BASE}/${filename}" 2>/dev/null +} + +compute_checksums() { + local version="$1" + local tmpdir + tmpdir=$(mktemp -d) + trap "rm -rf '$tmpdir'" EXIT + + echo "Downloading files from Go module proxy for v${version}..." >&2 + + local mod_file="${tmpdir}/v${version}.mod" + local zip_file="${tmpdir}/v${version}.zip" + + curl -sL "${GO_PROXY}/v${version}.mod" -o "$mod_file" 2>/dev/null + curl -sL "${GO_PROXY}/v${version}.zip" -o "$zip_file" 2>/dev/null + + if [ ! -s "$mod_file" ] || [ ! -s "$zip_file" ]; then + echo "Error: Could not download files from Go module proxy" >&2 + return 1 + fi + + local mod_sha256 mod_size zip_sha256 zip_size + + if command -v sha256sum &>/dev/null; then + mod_sha256=$(sha256sum "$mod_file" | awk '{print $1}') + zip_sha256=$(sha256sum "$zip_file" | awk '{print $1}') + elif command -v shasum &>/dev/null; then + mod_sha256=$(shasum -a 256 "$mod_file" | awk '{print $1}') + zip_sha256=$(shasum -a 256 "$zip_file" | awk '{print $1}') + else + echo "Error: No sha256 command found" >&2 + return 1 + fi + + if [[ "$OSTYPE" == "darwin"* ]]; then + mod_size=$(stat -f%z "$mod_file") + zip_size=$(stat -f%z "$zip_file") + else + mod_size=$(stat -c%s "$mod_file") + zip_size=$(stat -c%s "$zip_file") + fi + + echo "TIMESTAMP = $(date +%s)" + echo "SHA256 (go/security_netbird/netbird-v${version}/v${version}.mod) = ${mod_sha256}" + echo "SIZE (go/security_netbird/netbird-v${version}/v${version}.mod) = ${mod_size}" + echo "SHA256 (go/security_netbird/netbird-v${version}/v${version}.zip) = ${zip_sha256}" + echo "SIZE (go/security_netbird/netbird-v${version}/v${version}.zip) = ${zip_size}" +} + +generate_new_makefile() { + local old_version="$1" + local new_version="$2" + local old_makefile="$3" + + # Check if old version had PORTREVISION + if echo "$old_makefile" | grep -q "^PORTREVISION="; then + # Remove PORTREVISION line and update DISTVERSION + echo "$old_makefile" | \ + sed "s/^DISTVERSION=.*/DISTVERSION= ${new_version}/" | \ + grep -v "^PORTREVISION=" + else + # Just update DISTVERSION + echo "$old_makefile" | \ + sed "s/^DISTVERSION=.*/DISTVERSION= ${new_version}/" + fi +} + +# Parse arguments +NEW_VERSION="${1:-}" + +# Auto-detect versions if not provided +OLD_VERSION=$(fetch_current_ports_version) +if [ -z "$OLD_VERSION" ]; then + echo "Error: Could not fetch current version from FreeBSD ports" >&2 + exit 1 +fi +echo "Current FreeBSD ports version: ${OLD_VERSION}" >&2 + +if [ -z "$NEW_VERSION" ]; then + NEW_VERSION=$(fetch_latest_github_release) + if [ -z "$NEW_VERSION" ]; then + echo "Error: Could not fetch latest release from GitHub" >&2 + exit 1 + fi +fi +echo "Target version: ${NEW_VERSION}" >&2 + +if [ "$OLD_VERSION" = "$NEW_VERSION" ]; then + echo "Port is already at version ${NEW_VERSION}. Nothing to do." >&2 + exit 0 +fi + +echo "" >&2 + +# Fetch current files +echo "Fetching current Makefile from FreeBSD ports..." >&2 +OLD_MAKEFILE=$(fetch_ports_file "Makefile") +if [ -z "$OLD_MAKEFILE" ]; then + echo "Error: Could not fetch Makefile" >&2 + exit 1 +fi + +echo "Fetching current distinfo from FreeBSD ports..." >&2 +OLD_DISTINFO=$(fetch_ports_file "distinfo") +if [ -z "$OLD_DISTINFO" ]; then + echo "Error: Could not fetch distinfo" >&2 + exit 1 +fi + +# Generate new files +echo "Generating new Makefile..." >&2 +NEW_MAKEFILE=$(generate_new_makefile "$OLD_VERSION" "$NEW_VERSION" "$OLD_MAKEFILE") + +echo "Computing checksums for new version..." >&2 +NEW_DISTINFO=$(compute_checksums "$NEW_VERSION") +if [ -z "$NEW_DISTINFO" ]; then + echo "Error: Could not compute checksums" >&2 + exit 1 +fi + +# Create temp files for diff +TMPDIR=$(mktemp -d) +trap "rm -rf '$TMPDIR'" EXIT + +mkdir -p "${TMPDIR}/a/security/netbird" "${TMPDIR}/b/security/netbird" + +echo "$OLD_MAKEFILE" > "${TMPDIR}/a/security/netbird/Makefile" +echo "$OLD_DISTINFO" > "${TMPDIR}/a/security/netbird/distinfo" +echo "$NEW_MAKEFILE" > "${TMPDIR}/b/security/netbird/Makefile" +echo "$NEW_DISTINFO" > "${TMPDIR}/b/security/netbird/distinfo" + +# Generate diff +OUTPUT_FILE="${OUTPUT_DIR}/netbird-${NEW_VERSION}.diff" + +echo "" >&2 +echo "Generating diff..." >&2 + +# Generate diff and clean up temp paths to show standard a/b paths +(cd "${TMPDIR}" && diff -ruN "a/security/netbird" "b/security/netbird") > "$OUTPUT_FILE" || true + +if [ ! -s "$OUTPUT_FILE" ]; then + echo "Error: Generated diff is empty" >&2 + exit 1 +fi + +echo "" >&2 +echo "=========================================" +echo "Diff saved to: ${OUTPUT_FILE}" +echo "=========================================" +echo "" +cat "$OUTPUT_FILE" +echo "" +echo "=========================================" +echo "" +echo "Next steps:" +echo "1. Review the diff above" +echo "2. Submit to https://bugs.freebsd.org/bugzilla/" +echo "3. Use ./freebsd-port-issue-body.sh to generate the issue content" +echo "" +echo "For FreeBSD testing (optional but recommended):" +echo " cd /usr/ports/security/netbird" +echo " patch < ${OUTPUT_FILE}" +echo " make stage && make stage-qa && make package && make install" +echo " netbird status" +echo " make deinstall" diff --git a/release_files/freebsd-port-issue-body.sh b/release_files/freebsd-port-issue-body.sh new file mode 100755 index 00000000000..bc459b32492 --- /dev/null +++ b/release_files/freebsd-port-issue-body.sh @@ -0,0 +1,154 @@ +#!/bin/bash +# +# FreeBSD Port Issue Body Generator for NetBird +# +# This script generates the issue body content for submitting a FreeBSD port update +# to the FreeBSD Bugzilla at https://bugs.freebsd.org/bugzilla/ +# +# Usage: ./freebsd-port-issue-body.sh [old_version] [new_version] +# Example: ./freebsd-port-issue-body.sh 0.56.0 0.59.1 +# +# If no versions are provided, the script will: +# - Fetch OLD version from FreeBSD ports cgit (current version in ports tree) +# - Fetch NEW version from latest NetBird GitHub release tag + +set -e + +GITHUB_REPO="netbirdio/netbird" +PORTS_CGIT_URL="https://cgit.freebsd.org/ports/plain/security/netbird/Makefile" + +fetch_current_ports_version() { + echo "Fetching current version from FreeBSD ports..." >&2 + local makefile_content + makefile_content=$(curl -sL "$PORTS_CGIT_URL" 2>/dev/null) + if [ -z "$makefile_content" ]; then + echo "Error: Could not fetch Makefile from FreeBSD ports" >&2 + return 1 + fi + echo "$makefile_content" | grep -E "^DISTVERSION=" | sed 's/DISTVERSION=[[:space:]]*//' | tr -d '\t ' +} + +fetch_all_tags() { + # Fetch tags from GitHub tags page (no rate limiting, no auth needed) + curl -sL "https://github.com/${GITHUB_REPO}/tags" 2>/dev/null | \ + grep -oE '/releases/tag/v[0-9]+\.[0-9]+\.[0-9]+' | \ + sed 's/.*\/v//' | \ + sort -u -V +} + +fetch_latest_github_release() { + echo "Fetching latest release from GitHub..." >&2 + local latest + + # Fetch from GitHub tags page + latest=$(fetch_all_tags | tail -1) + + if [ -z "$latest" ]; then + # Fallback to GitHub API + latest=$(curl -sL "https://api.github.com/repos/${GITHUB_REPO}/releases/latest" 2>/dev/null | \ + grep '"tag_name"' | sed 's/.*"tag_name": *"v\([^"]*\)".*/\1/') + fi + + if [ -z "$latest" ]; then + echo "Error: Could not fetch latest release from GitHub" >&2 + return 1 + fi + echo "$latest" +} + +OLD_VERSION="${1:-}" +NEW_VERSION="${2:-}" + +if [ -z "$OLD_VERSION" ]; then + OLD_VERSION=$(fetch_current_ports_version) + if [ -z "$OLD_VERSION" ]; then + echo "Error: Could not determine old version. Please provide it manually." >&2 + echo "Usage: $0 " >&2 + exit 1 + fi + echo "Detected OLD version from FreeBSD ports: $OLD_VERSION" >&2 +fi + +if [ -z "$NEW_VERSION" ]; then + NEW_VERSION=$(fetch_latest_github_release) + if [ -z "$NEW_VERSION" ]; then + echo "Error: Could not determine new version. Please provide it manually." >&2 + echo "Usage: $0 " >&2 + exit 1 + fi + echo "Detected NEW version from GitHub: $NEW_VERSION" >&2 +fi + +if [ "$OLD_VERSION" = "$NEW_VERSION" ]; then + echo "Warning: OLD and NEW versions are the same ($OLD_VERSION). Port may already be up to date." >&2 +fi + +echo "" >&2 + +OUTPUT_DIR="${OUTPUT_DIR:-.}" + +fetch_releases_between_versions() { + echo "Fetching release history from GitHub..." >&2 + + # Fetch all tags and filter to those between OLD and NEW versions + fetch_all_tags | \ + while read -r ver; do + if [ "$(printf '%s\n' "$OLD_VERSION" "$ver" | sort -V | head -n1)" = "$OLD_VERSION" ] && \ + [ "$(printf '%s\n' "$ver" "$NEW_VERSION" | sort -V | head -n1)" = "$ver" ] && \ + [ "$ver" != "$OLD_VERSION" ]; then + echo "$ver" + fi + done +} + +generate_changelog_section() { + local releases + releases=$(fetch_releases_between_versions) + + echo "Changelogs:" + if [ -n "$releases" ]; then + echo "$releases" | while read -r ver; do + echo "https://github.com/${GITHUB_REPO}/releases/tag/v${ver}" + done + else + echo "https://github.com/${GITHUB_REPO}/releases/tag/v${NEW_VERSION}" + fi +} + +OUTPUT_FILE="${OUTPUT_DIR}/netbird-${NEW_VERSION}-issue.txt" + +cat << EOF > "$OUTPUT_FILE" +BUGZILLA ISSUE DETAILS +====================== + +Severity: Affects Some People + +Summary: security/netbird: Update to ${NEW_VERSION} + +Description: +------------ +security/netbird: Update ${OLD_VERSION} => ${NEW_VERSION} + +$(generate_changelog_section) + +Commit log: +https://github.com/${GITHUB_REPO}/compare/v${OLD_VERSION}...v${NEW_VERSION} +EOF + +echo "=========================================" +echo "Issue body saved to: ${OUTPUT_FILE}" +echo "=========================================" +echo "" +cat "$OUTPUT_FILE" +echo "" +echo "=========================================" +echo "" +echo "Next steps:" +echo "1. Go to https://bugs.freebsd.org/bugzilla/ and login" +echo "2. Click 'Report an update or defect to a port'" +echo "3. Fill in:" +echo " - Severity: Affects Some People" +echo " - Summary: security/netbird: Update to ${NEW_VERSION}" +echo " - Description: Copy content from ${OUTPUT_FILE}" +echo "4. Attach diff file: netbird-${NEW_VERSION}.diff" +echo "5. Submit the bug report" From 04b47b991105635de88f12428f88581cfee01232 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Fri, 5 Dec 2025 12:34:14 +0100 Subject: [PATCH 02/19] test steps --- .github/workflows/release.yml | 66 ++++++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 48bbd16e055..fadf652c551 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,13 +20,70 @@ concurrency: jobs: release_freebsd_port: - runs-on: ubuntu-latest + name: "FreeBSD Port / Build & Test" + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v4 - - run: bash release_files/freebsd-port-diff.sh - - run: bash release_files/freebsd-port-issue-body.sh - - name: upload freebsd port files + + - name: Generate FreeBSD port diff + run: bash release_files/freebsd-port-diff.sh + + - name: Generate FreeBSD port issue body + run: bash release_files/freebsd-port-issue-body.sh + + - name: Extract version + id: version + run: | + VERSION=$(ls netbird-*.diff | sed 's/netbird-\(.*\)\.diff/\1/') + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "Generated files for version: $VERSION" + cat netbird-*.diff + + - name: Test FreeBSD port + uses: vmactions/freebsd-vm@v1 + with: + usesh: true + copyback: false + release: "14.2" + prepare: | + # Install required packages + pkg install -y git curl portlint + + # Install Go for building + GO_TARBALL="go1.24.10.freebsd-amd64.tar.gz" + GO_URL="https://go.dev/dl/$GO_TARBALL" + curl -LO "$GO_URL" + tar -C /usr/local -xzf "$GO_TARBALL" + + # Clone ports tree (shallow, only security/netbird) + git clone --depth 1 --filter=blob:none --sparse https://git.FreeBSD.org/ports.git /usr/ports + cd /usr/ports + git sparse-checkout set security/netbird + + run: | + set -e -x + export PATH=$PATH:/usr/local/go/bin + + cd /usr/ports/security/netbird + + # Apply the generated diff + patch -p2 < /home/runner/work/netbird/netbird/netbird-${{ steps.version.outputs.version }}.diff + + # Run port linting + portlint -AC || true + + # Build and test the port + make stage + make stage-qa || true + make package + + # Verify the package was created + ls -la /usr/ports/security/netbird/work/pkg/ + + echo "FreeBSD port test completed successfully!" + + - name: Upload FreeBSD port files uses: actions/upload-artifact@v4 with: name: freebsd-port-files @@ -34,6 +91,7 @@ jobs: ./netbird-*-issue.txt ./netbird-*.diff retention-days: 30 + release: runs-on: ubuntu-latest-m env: From 7c44f607b8e72e702f40c260fe3a040571498572 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Fri, 5 Dec 2025 12:43:24 +0100 Subject: [PATCH 03/19] fix tests --- .github/workflows/release.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fadf652c551..f829ced79f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,10 +42,13 @@ jobs: - name: Test FreeBSD port uses: vmactions/freebsd-vm@v1 + env: + DIFF_FILE: netbird-${{ steps.version.outputs.version }}.diff with: usesh: true copyback: false release: "14.2" + envs: "DIFF_FILE" prepare: | # Install required packages pkg install -y git curl portlint @@ -65,10 +68,15 @@ jobs: set -e -x export PATH=$PATH:/usr/local/go/bin + # vmactions syncs workspace to current working directory + echo "Current directory: $(pwd)" + echo "Contents:" + ls -la + cd /usr/ports/security/netbird # Apply the generated diff - patch -p2 < /home/runner/work/netbird/netbird/netbird-${{ steps.version.outputs.version }}.diff + patch -p2 < ~/$DIFF_FILE # Run port linting portlint -AC || true From 0f697a9cbf115f717278262afda7e77f808d6eef Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Fri, 5 Dec 2025 12:52:43 +0100 Subject: [PATCH 04/19] [ci] Fix FreeBSD port diff handling in release workflow --- .github/workflows/release.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f829ced79f0..c8957561d8c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,13 +42,10 @@ jobs: - name: Test FreeBSD port uses: vmactions/freebsd-vm@v1 - env: - DIFF_FILE: netbird-${{ steps.version.outputs.version }}.diff with: usesh: true copyback: false release: "14.2" - envs: "DIFF_FILE" prepare: | # Install required packages pkg install -y git curl portlint @@ -68,15 +65,21 @@ jobs: set -e -x export PATH=$PATH:/usr/local/go/bin - # vmactions syncs workspace to current working directory - echo "Current directory: $(pwd)" - echo "Contents:" - ls -la + # Find the diff file + echo "Finding diff file..." + DIFF_FILE=$(find ~ -name "netbird-*.diff" -type f 2>/dev/null | head -1) + echo "Found: $DIFF_FILE" + + if [ -z "$DIFF_FILE" ]; then + echo "ERROR: Could not find diff file" + find ~ -name "*.diff" -type f 2>/dev/null || true + exit 1 + fi cd /usr/ports/security/netbird # Apply the generated diff - patch -p2 < ~/$DIFF_FILE + patch -p2 < "$DIFF_FILE" # Run port linting portlint -AC || true From 3ab0d09b048dfb10f7cab047863134c6dc8d1ae8 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Fri, 5 Dec 2025 13:07:52 +0100 Subject: [PATCH 05/19] [ci] Update release workflow to fix FreeBSD port diff file lookup --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c8957561d8c..789569354a2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,7 +67,7 @@ jobs: # Find the diff file echo "Finding diff file..." - DIFF_FILE=$(find ~ -name "netbird-*.diff" -type f 2>/dev/null | head -1) + DIFF_FILE=$(find . -name "netbird-*.diff" -type f 2>/dev/null | head -1) echo "Found: $DIFF_FILE" if [ -z "$DIFF_FILE" ]; then @@ -77,7 +77,7 @@ jobs: fi cd /usr/ports/security/netbird - + git --no-pager diff --exit-code || true # Apply the generated diff patch -p2 < "$DIFF_FILE" From fff39929d8bd2c9145d9cbc9930b47ace3cc2767 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Fri, 5 Dec 2025 14:58:27 +0100 Subject: [PATCH 06/19] [ci] Fix release workflow to use absolute path for diff file lookup --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 789569354a2..b458c95eb7e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,7 +67,7 @@ jobs: # Find the diff file echo "Finding diff file..." - DIFF_FILE=$(find . -name "netbird-*.diff" -type f 2>/dev/null | head -1) + DIFF_FILE=$(find $PWD -name "netbird-*.diff" -type f 2>/dev/null | head -1) echo "Found: $DIFF_FILE" if [ -z "$DIFF_FILE" ]; then @@ -77,7 +77,6 @@ jobs: fi cd /usr/ports/security/netbird - git --no-pager diff --exit-code || true # Apply the generated diff patch -p2 < "$DIFF_FILE" From 5078da2b88491684559cb751feabde6c5fd35f23 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Fri, 5 Dec 2025 15:04:16 +0100 Subject: [PATCH 07/19] [ci] Fix patch application path in FreeBSD release workflow --- .github/workflows/release.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b458c95eb7e..a0d0465f324 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -76,9 +76,12 @@ jobs: exit 1 fi + # Apply the generated diff from /usr/ports (diff has a/security/netbird/... paths) + cd /usr/ports + cat security/netbird/Makefile || true + patch -p1 < "$DIFF_FILE" + cd /usr/ports/security/netbird - # Apply the generated diff - patch -p2 < "$DIFF_FILE" # Run port linting portlint -AC || true From aa2e6fbd7b261471af958a6bd0ec994d69ebad49 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Fri, 5 Dec 2025 16:39:23 +0100 Subject: [PATCH 08/19] [ci] Update FreeBSD release workflow to adjust sparse-checkout paths --- .github/workflows/release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a0d0465f324..43f30964021 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,10 +56,10 @@ jobs: curl -LO "$GO_URL" tar -C /usr/local -xzf "$GO_TARBALL" - # Clone ports tree (shallow, only security/netbird) + # Clone ports tree (shallow, only what we need) git clone --depth 1 --filter=blob:none --sparse https://git.FreeBSD.org/ports.git /usr/ports cd /usr/ports - git sparse-checkout set security/netbird + git sparse-checkout set Mk Templates Keywords security/netbird run: | set -e -x @@ -80,6 +80,8 @@ jobs: cd /usr/ports cat security/netbird/Makefile || true patch -p1 < "$DIFF_FILE" + + cat security/netbird/Makefile || true cd /usr/ports/security/netbird From 701144a08ca2bc5b51967627dd8d8793465aa977 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Fri, 5 Dec 2025 16:58:46 +0100 Subject: [PATCH 09/19] [ci] Update FreeBSD workflow to refine patch application and Makefile display --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 43f30964021..a0c55d2a6b1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,10 +78,10 @@ jobs: # Apply the generated diff from /usr/ports (diff has a/security/netbird/... paths) cd /usr/ports - cat security/netbird/Makefile || true - patch -p1 < "$DIFF_FILE" - - cat security/netbird/Makefile || true + patch -p1 --no-backup-if-mismatch < "$DIFF_FILE" + + # Show patched Makefile + cat security/netbird/Makefile cd /usr/ports/security/netbird From 329de3eba5329aa2692ac77af2467474940d89aa Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Mon, 8 Dec 2025 00:49:47 +0100 Subject: [PATCH 10/19] update-test --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a0c55d2a6b1..4a23401db2b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,7 +78,7 @@ jobs: # Apply the generated diff from /usr/ports (diff has a/security/netbird/... paths) cd /usr/ports - patch -p1 --no-backup-if-mismatch < "$DIFF_FILE" + patch -p1 -V none < "$DIFF_FILE" # Show patched Makefile cat security/netbird/Makefile From 37acb2abdf140cd21a0455373db0841bb66867bb Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Mon, 8 Dec 2025 13:41:28 +0100 Subject: [PATCH 11/19] remove sparse --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a23401db2b..cb6ad0a760f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,7 +59,7 @@ jobs: # Clone ports tree (shallow, only what we need) git clone --depth 1 --filter=blob:none --sparse https://git.FreeBSD.org/ports.git /usr/ports cd /usr/ports - git sparse-checkout set Mk Templates Keywords security/netbird + # git sparse-checkout set Mk Templates Keywords security/netbird run: | set -e -x From d15523096f78e433d22c2443fa4fc7848b760826 Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Mon, 8 Dec 2025 13:46:34 +0100 Subject: [PATCH 12/19] remove sparse --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cb6ad0a760f..6884780107a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,7 +57,7 @@ jobs: tar -C /usr/local -xzf "$GO_TARBALL" # Clone ports tree (shallow, only what we need) - git clone --depth 1 --filter=blob:none --sparse https://git.FreeBSD.org/ports.git /usr/ports + git clone --depth 1 --filter=blob:none https://git.FreeBSD.org/ports.git /usr/ports cd /usr/ports # git sparse-checkout set Mk Templates Keywords security/netbird From 8b8b798c15ef966db48831b88cb67100e5bcb1ba Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Mon, 8 Dec 2025 14:15:01 +0100 Subject: [PATCH 13/19] update freebsd release --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6884780107a..9e14bc063ce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: with: usesh: true copyback: false - release: "14.2" + release: "15.0" prepare: | # Install required packages pkg install -y git curl portlint From f0668681c86ff1efc4468c2c6d169c0cc383475d Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Mon, 8 Dec 2025 14:46:33 +0100 Subject: [PATCH 14/19] install netbird --- .github/workflows/release.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e14bc063ce..a75e51b71c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,19 +82,10 @@ jobs: # Show patched Makefile cat security/netbird/Makefile - - cd /usr/ports/security/netbird - - # Run port linting - portlint -AC || true - - # Build and test the port - make stage - make stage-qa || true - make package - - # Verify the package was created - ls -la /usr/ports/security/netbird/work/pkg/ + + port install netbird + + netbird version echo "FreeBSD port test completed successfully!" From 6f6da2730ce8f1b110850bdf9dd0acd9d214b9e9 Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Mon, 8 Dec 2025 14:51:52 +0100 Subject: [PATCH 15/19] use pkg --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a75e51b71c8..52d052fa1cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,7 +83,7 @@ jobs: # Show patched Makefile cat security/netbird/Makefile - port install netbird + pkg install netbird netbird version From b8ab864ba10b96aa8fe00e5d81dac8d9fb9a3318 Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Mon, 8 Dec 2025 15:03:56 +0100 Subject: [PATCH 16/19] make package --- .github/workflows/release.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 52d052fa1cc..aa3dd1ef8f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,7 +59,6 @@ jobs: # Clone ports tree (shallow, only what we need) git clone --depth 1 --filter=blob:none https://git.FreeBSD.org/ports.git /usr/ports cd /usr/ports - # git sparse-checkout set Mk Templates Keywords security/netbird run: | set -e -x @@ -81,11 +80,13 @@ jobs: patch -p1 -V none < "$DIFF_FILE" # Show patched Makefile - cat security/netbird/Makefile + version=$(cat security/netbird/Makefile | grep DISTVERSION | awk '{print $NF}') - pkg install netbird + cd /usr/ports/security/netbird + make package + pkg add -y ./work/pkg/netbird-*.pkg - netbird version + netbird version | grep $version echo "FreeBSD port test completed successfully!" From ef5aa2e57a28e84bd0f1f949cfbf00b9b6cdaf17 Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Mon, 8 Dec 2025 15:18:49 +0100 Subject: [PATCH 17/19] export batch=yes --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa3dd1ef8f0..4436b1922fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,6 +83,7 @@ jobs: version=$(cat security/netbird/Makefile | grep DISTVERSION | awk '{print $NF}') cd /usr/ports/security/netbird + export BATCH=yes make package pkg add -y ./work/pkg/netbird-*.pkg From b38d42582b9d427638adb053afe2dd8396f5f72f Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Mon, 8 Dec 2025 16:03:35 +0100 Subject: [PATCH 18/19] install go on pre --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4436b1922fd..3857af5fae9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,7 +48,7 @@ jobs: release: "15.0" prepare: | # Install required packages - pkg install -y git curl portlint + pkg install -y git curl portlint go # Install Go for building GO_TARBALL="go1.24.10.freebsd-amd64.tar.gz" @@ -85,7 +85,7 @@ jobs: cd /usr/ports/security/netbird export BATCH=yes make package - pkg add -y ./work/pkg/netbird-*.pkg + pkg add ./work/pkg/netbird-*.pkg netbird version | grep $version From 87500722485766f615f0641a49558cbed2bf2e67 Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Mon, 8 Dec 2025 21:22:18 +0100 Subject: [PATCH 19/19] fix version grep --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3857af5fae9..c29898593b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,7 +80,7 @@ jobs: patch -p1 -V none < "$DIFF_FILE" # Show patched Makefile - version=$(cat security/netbird/Makefile | grep DISTVERSION | awk '{print $NF}') + version=$(cat security/netbird/Makefile | grep -E '^DISTVERSION=' | awk '{print $NF}') cd /usr/ports/security/netbird export BATCH=yes