chore(governance): ship binaries to Pandora's Box Generic Packages (DEV-357) #8

Merged
David merged 1 commit from chore/governance-alignment-DEV-357 into main 2026-06-05 19:36:43 +02:00
Owner

Brings umbra to NiceGuyIT/governance spec for a Pandora's Box public desktop GUI/CLI (see DEV-357). Per BUILD.md's decision tree, a repo with no service container ships distributable binaries to the Forgejo Generic Packages registry rather than an OCI runtime image. Completes the in-progress alignment branch.

What changed

Version stamping (3-part, governance CI.md). crates/umbra-build now emits UMBRA_VERSION (git describe --tags --always --dirty, CI override, or CARGO_PKG_VERSION fallback) alongside UMBRA_GIT_HASH (short=12) and UMBRA_BUILD_DATE. The banners in umbra-cli, umbra-gui, and umbra-hid/src/version.rs read env!("UMBRA_VERSION"). umbra --version now prints umbra <version> (<git-hash> built <date>).

Windows portability. The hidapi backend feature is now target-conditional. [workspace.dependencies] carries no backend feature (per-target features cannot live there); each consuming crate selects linux-static-hidraw under cfg(target_os = "linux") and windows-native under cfg(windows). The udev module already had cfg(unix) / cfg(not(unix)) stubs.

Build tooling -> oci-build/. Dockerfile.binary-linux (from rust-builder-glibc, since hidapi links libudev/libusb and eframe links X11/Wayland/GL/fontconfig) and Dockerfile.binary-windows (from rust-builder-glibc-windows, mingw cross-compile) each build --workspace --locked and export umbra + umbra-gui from a FROM scratch AS binary stage. Adds the shared get-tags.nu. The root runtime-image Dockerfile is removed.

Workflows. build-binary-linux.yml and build-binary-windows.yml publish both binaries per tag via nu http delete / http put, step-scoped FORGEJO_TOKEN, PACKAGE_OWNER: github.repository_owner (resolves to pandoras-box). create-release.yml matches the governance template. check.yml aligns to the CI.md Check template. CARGO_BUILD_JOBS is capped at nproc/2 because the two binary workflows run as siblings on one runner.

Housekeeping. justfile gains build-binary-linux / build-binary-windows (replacing the old build-docker recipes) and repoints check-docker; Cargo.toml repository points at this repo; adds LICENSE.md (GPL-2.0-or-later, faithful to the OpenRazer fork origin) and CLAUDE.md; .dockerignore drops the stale root-Dockerfile exclusion.

Verification

Local (this host): cargo build --locked --workspace, cargo clippy --workspace --all-targets --no-deps -- --deny warnings, cargo fmt --all --check, and cargo test --workspace (19 + 1 doc-test) all green. Cargo.lock unchanged under --locked. umbra --version prints the 3-part banner.

The Windows mingw cross-compile and the Linux binary Docker build are verified by CI only (no Docker/mingw on the local host). Per the DEV-357 assumption, if the eframe/glow mingw build cannot compile, the Windows workflow is reported red rather than blocking the Linux deliverable.

Out of scope

README.md still has upstream-fork leftovers (cd rust, a .github/workflows/rust.yml reference, and a "Cross-compilation: not provided" note that now contradicts the Windows workflow). Not touched here; flag for a follow-up if desired.

Brings `umbra` to `NiceGuyIT/governance` spec for a Pandora's Box public desktop GUI/CLI (see DEV-357). Per BUILD.md's decision tree, a repo with no service container ships distributable binaries to the Forgejo Generic Packages registry rather than an OCI runtime image. Completes the in-progress alignment branch. ## What changed **Version stamping (3-part, governance CI.md).** `crates/umbra-build` now emits `UMBRA_VERSION` (`git describe --tags --always --dirty`, CI override, or `CARGO_PKG_VERSION` fallback) alongside `UMBRA_GIT_HASH` (short=12) and `UMBRA_BUILD_DATE`. The banners in `umbra-cli`, `umbra-gui`, and `umbra-hid/src/version.rs` read `env!("UMBRA_VERSION")`. `umbra --version` now prints `umbra <version> (<git-hash> built <date>)`. **Windows portability.** The hidapi backend feature is now target-conditional. `[workspace.dependencies]` carries no backend feature (per-target features cannot live there); each consuming crate selects `linux-static-hidraw` under `cfg(target_os = "linux")` and `windows-native` under `cfg(windows)`. The udev module already had `cfg(unix)` / `cfg(not(unix))` stubs. **Build tooling -> `oci-build/`.** `Dockerfile.binary-linux` (from `rust-builder-glibc`, since hidapi links libudev/libusb and eframe links X11/Wayland/GL/fontconfig) and `Dockerfile.binary-windows` (from `rust-builder-glibc-windows`, mingw cross-compile) each build `--workspace --locked` and export `umbra` + `umbra-gui` from a `FROM scratch AS binary` stage. Adds the shared `get-tags.nu`. The root runtime-image `Dockerfile` is removed. **Workflows.** `build-binary-linux.yml` and `build-binary-windows.yml` publish both binaries per tag via nu `http delete` / `http put`, step-scoped `FORGEJO_TOKEN`, `PACKAGE_OWNER: github.repository_owner` (resolves to `pandoras-box`). `create-release.yml` matches the governance template. `check.yml` aligns to the CI.md Check template. `CARGO_BUILD_JOBS` is capped at `nproc/2` because the two binary workflows run as siblings on one runner. **Housekeeping.** justfile gains `build-binary-linux` / `build-binary-windows` (replacing the old `build-docker` recipes) and repoints `check-docker`; `Cargo.toml` `repository` points at this repo; adds `LICENSE.md` (GPL-2.0-or-later, faithful to the OpenRazer fork origin) and `CLAUDE.md`; `.dockerignore` drops the stale root-`Dockerfile` exclusion. ## Verification Local (this host): `cargo build --locked --workspace`, `cargo clippy --workspace --all-targets --no-deps -- --deny warnings`, `cargo fmt --all --check`, and `cargo test --workspace` (19 + 1 doc-test) all green. `Cargo.lock` unchanged under `--locked`. `umbra --version` prints the 3-part banner. The Windows mingw cross-compile and the Linux binary Docker build are verified by CI only (no Docker/mingw on the local host). Per the DEV-357 assumption, if the eframe/glow mingw build cannot compile, the Windows workflow is reported red rather than blocking the Linux deliverable. ## Out of scope `README.md` still has upstream-fork leftovers (`cd rust`, a `.github/workflows/rust.yml` reference, and a "Cross-compilation: not provided" note that now contradicts the Windows workflow). Not touched here; flag for a follow-up if desired.
chore(governance): ship binaries to Pandora's Box Generic Packages
Some checks failed
Check / fmt + clippy + build + tests (pull_request) Failing after 17s
Create release / Create release from merged PR (pull_request) Has been skipped
6ad5ea2442
Bring umbra to NiceGuyIT/governance spec for a Pandora's Box public desktop GUI/CLI: Docker is the build tool, the deliverable is a distributable binary published to the `pandoras-box` Forgejo Generic Packages registry, not an OCI runtime image.

3-part version stamp (governance CI.md "Version stamping"): `crates/umbra-build` now emits `UMBRA_VERSION` (`git describe --tags --always --dirty`, CI override, or `CARGO_PKG_VERSION` fallback) alongside the existing `UMBRA_GIT_HASH` (short=12) and `UMBRA_BUILD_DATE`. The banners in umbra-cli, umbra-gui, and umbra-hid/src/version.rs read `env!("UMBRA_VERSION")`, so `umbra --version` prints all three parts.

Windows portability: the hidapi backend feature is now target-conditional. `[workspace.dependencies]` carries no backend feature (per-target features are not expressible there); each consuming crate declares hidapi under `[target.'cfg(target_os = "linux")']` (linux-static-hidraw) and `[target.'cfg(windows)']` (windows-native).

Build tooling moves to oci-build/: `Dockerfile.binary-linux` (rust-builder-glibc) and `Dockerfile.binary-windows` (rust-builder-glibc-windows mingw cross-compile) each build `--workspace --locked` and export `umbra` + `umbra-gui` from a `FROM scratch AS binary` stage; plus the shared `get-tags.nu`. The root runtime-image Dockerfile is removed.

Workflows: `build-binary-linux.yml` and `build-binary-windows.yml` publish both binaries per tag via nu `http delete`/`http put` with step-scoped `FORGEJO_TOKEN` and `PACKAGE_OWNER: github.repository_owner`; `create-release.yml` matches the governance template; `check.yml` aligns to the CI.md Check template (checkout@v5, toolchain step, Swatinem/rust-cache@v2). CARGO_BUILD_JOBS is capped at nproc/2 since the two binary workflows run as siblings.

justfile gains `build-binary-linux` / `build-binary-windows` (replacing the old build-docker recipes), repoints `check-docker` at the builder stage, and threads UMBRA_VERSION through every build arg. Cargo.toml `repository` points at this repo. Adds LICENSE.md (GPL-2.0-or-later, faithful to the OpenRazer fork origin) and CLAUDE.md.

Signed-off-by: David Randall <David@NiceGuyIT.biz>

#DEV-357
David merged commit bd9a271289 into main 2026-06-05 19:36:43 +02:00
David deleted branch chore/governance-alignment-DEV-357 2026-06-05 19:36:43 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pandoras-box/umbra!8
No description provided.