FreeBSD: package in the FreeBSD CI job; release job matches its VM setup

Builds on #45's FreeBSD workflow: it now also runs packaging/freebsd/package.sh
end to end (a quicker release profile) and triggers on packaging changes. The
release job uses the same packages, 4 vCPUs and safe.directory, and removes
target/ in the VM before copying dist/ back out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas 2026-10-05 10:18:50 -04:00
parent 37748260ff
commit 0447a0fc7b
2 changed files with 10 additions and 4 deletions

View File

@ -11,6 +11,7 @@ on:
- Cargo.lock
- "**/Cargo.toml"
- .github/workflows/freebsd.yml
- packaging/freebsd/**
workflow_dispatch:
concurrency:
@ -37,7 +38,7 @@ jobs:
# Nothing to bring back; copying the target dir out of the VM fails on large builds.
copyback: false
prepare: |
pkg install -y git curl pkgconf cmake python3 libxkbcommon wayland libX11 libXcursor libXrandr libXi libxcb mesa-libs vulkan-loader gtk3 fontconfig freetype2 alsa-lib
pkg install -y bash git curl pkgconf cmake python3 libxkbcommon wayland libX11 libXcursor libXrandr libXi libxcb mesa-libs vulkan-loader gtk3 fontconfig freetype2 alsa-lib
curl -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal
run: |
. "$HOME/.cargo/env"
@ -46,3 +47,6 @@ jobs:
rustc --version
CARGO_PROFILE_DEV_DEBUG=0 cargo build --workspace --all-targets --locked
CARGO_PROFILE_DEV_DEBUG=0 cargo test --workspace --locked
# The release packaging, end to end (a quicker release profile than the real release).
CARGO_PROFILE_RELEASE_LTO=false CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16 packaging/freebsd/package.sh
tar -tzf dist/release/printcraft-*-freebsd-*.tar.gz | grep -E '/bin/printcraft$|/bin/printcraft-cli$|applications/'

View File

@ -220,19 +220,21 @@ jobs:
with:
release: "14.3"
usesh: true
cpu: 4
mem: 12288
envs: "PRINTCRAFT_VERSION PRINTCRAFT_BUILD_DATE VERSION_OVERRIDE"
# The same packages as the FreeBSD CI workflow, plus bash for the packaging script.
prepare: |
pkg install -y bash curl git cmake pkgconf llvm19 perl5 \
libxkbcommon wayland libX11 libXrandr libXi libXcursor mesa-libs gtk3
pkg install -y bash git curl pkgconf cmake python3 libxkbcommon wayland libX11 libXcursor libXrandr libXi libxcb mesa-libs vulkan-loader gtk3 fontconfig freetype2 alsa-lib
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable
run: |
set -e
. "$HOME/.cargo/env"
git config --global --add safe.directory "$PWD"
export LIBCLANG_PATH=/usr/local/llvm19/lib CARGO_BUILD_JOBS=4
if [ -n "$VERSION_OVERRIDE" ]; then cargo xtask version set "$PRINTCRAFT_VERSION"; fi
packaging/freebsd/package.sh
# Only dist/ comes back out of the VM: copying the target dir back fails on large builds.
rm -rf target
- uses: actions/upload-artifact@v4
with:
name: release-freebsd-x86_64