[ci] Add FreeBSD port release job to GitHub Actions
Describe your changes
Includes scripts for generating FreeBSD port update diff and issue body.
Issue ticket number and link
Stack
Checklist
- [ ] Is it a bug fix
- [ ] Is a typo/documentation fix
- [x] Is a feature enhancement
- [ ] It is a refactor
- [ ] Created tests that fail without the change (if possible)
By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.
Documentation
Select exactly one:
- [ ] I added/updated documentation for this change
- [x] Documentation is not needed for this change (explain why)
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__
Summary by CodeRabbit
-
New Features
- Added CLI tools to generate FreeBSD port update diffs and to produce ready-to-file issue bodies with changelogs and release links for review and filing.
-
Chores
- CI now includes a FreeBSD port workflow that prepares a VM, applies and builds the port update, verifies the installed version, and uploads generated diff and issue artifacts for review.
✏️ Tip: You can customize this high-level summary in your review settings.
Walkthrough
Adds a new GitHub Actions job release_freebsd_port plus two scripts (release_files/freebsd-port-diff.sh, release_files/freebsd-port-issue-body.sh) that generate a FreeBSD port diff and issue body, provision a FreeBSD VM to apply/lint/build the port, and upload resulting artifacts. (28 words)
Changes
| Cohort / File(s) | Summary |
|---|---|
Workflow job \.github/workflows/release.yml`` |
Adds release_freebsd_port job (runs on ubuntu-22.04) that checks out the repo, runs the port-diff and issue-body scripts, extracts the version, provisions a FreeBSD VM via vmactions/freebsd-vm@v1 to apply the diff, run portlint, build/QA/package the port, verify installed version, and upload a freebsd-port-files artifact (diff, issue text, packages). |
FreeBSD port diff script \release_files/freebsd-port-diff.sh`` |
New Bash script to detect OLD/NEW versions (FreeBSD ports cgit or GitHub tags), fetch old Makefile/distinfo, download Go module .mod and .zip from the Go proxy, compute SHA256 checksums and sizes, generate new Makefile/distinfo, create netbird-<new_version>.diff in the output dir, validate output, and print guidance. |
FreeBSD issue body script \release_files/freebsd-port-issue-body.sh`` |
New Bash script to determine OLD/NEW versions, gather GitHub release history and intermediate releases, assemble a changelog and compare URL, write netbird-<NEW_VERSION>-issue.txt with metadata and filing instructions, and print the generated content and next steps. |
Sequence Diagram(s)
sequenceDiagram
autonumber
participant GHA as GitHub Actions
participant Repo as Repository (scripts)
participant Ports as FreeBSD Ports (cgit)
participant GH as GitHub API
participant GMP as Go Module Proxy
participant VM as FreeBSD Test VM
participant Art as Artifact Storage
GHA->>Repo: checkout & run freebsd-port-diff.sh / freebsd-port-issue-body.sh
Repo->>Ports: fetch current Makefile & distinfo (OLD_VERSION)
Repo->>GH: fetch tags/releases (NEW_VERSION + history)
Repo->>GMP: download .mod and .zip for NEW_VERSION
Repo-->>Repo: compute checksums & sizes, build new Makefile/distinfo
Repo-->>Repo: generate unified diff and issue text files
GHA->>VM: provision VM, upload/apply diff, run portlint, build, install, verify
VM-->>GHA: return build & QA results and pkg artifacts
GHA->>Art: upload freebsd-port-files artifact (diff, issue text, packages)
Art-->>GHA: confirm upload
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~30 minutes
- Focus areas:
release_files/freebsd-port-diff.sh: version detection, network/fetch error handling, checksum & size computation, distinfo formatting, temp workspace and cleanup, diff correctness.release_files/freebsd-port-issue-body.sh: release-history parsing, intermediate-release link generation, version-range logic, output formatting..github/workflows/release.yml: job configuration, secrets/env passed to VM action, artifact paths, step ordering and failure handling.
Poem
🐰
I hopped through tags beneath the moon,
fetched checksums, hummed a jaunty tune,
stitched a patch with whiskered care,
wrote the issue, left it there,
CI carrots tumble from the dune.
Pre-merge checks and finishing touches
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title accurately summarizes the main change—adding a FreeBSD port release job to GitHub Actions—which directly reflects the workflow file modifications and supporting scripts introduced in the PR. |
| Description check | ✅ Passed | The description covers the main change and properly fills required sections (checklist, documentation selection), though the 'Describe your changes' section is brief and the issue ticket/stack sections are empty. |
✨ Finishing touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
add-freebsd-file
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Quality Gate failed
Failed conditions
32 New issues
1 Security Hotspot
32 New Code Smells (required ≤ 0)
See analysis details on SonarQube Cloud
Catch issues before they fail your Quality Gate with our IDE extension
SonarQube for IDE