ci: publish the Zig FFI library image to GHCR#49
Merged
Conversation
Add a publish-image workflow + Containerfile so checky-monkey publishes its own
GHCR image, re-linking the ghcr.io/hyperpolymath/checky-monkey package back to
this repo (it was previously mis-attributed to odds-and-sods-package-manager,
which built a Rust/axum service that does not exist here).
checky-monkey is currently a Zig C-ABI library (libchecky_monkey.{so,a}) with
Idris2 ABI bindings — not a running service — so the image is a distribution
artifact carrying the compiled library for downstream FFI consumers.
Also fixes a pre-existing compile error so the library builds:
- ffi/zig/src/main.zig: `Handle` was declared as `opaque { ...fields... }`,
which Zig rejects (opaque types cannot carry fields). Declared it as a struct;
it is still exposed to C only as an opaque `*Handle` pointer.
- The Containerfile builds the lib directly with `zig build-lib ... -lc` (libc
is needed for std.heap.c_allocator), bypassing the in-tree build.zig, which is
a not-yet-instantiated scaffold template ({{project}} placeholders + a missing
include/ header).
Verified locally with Zig 0.13.0: both the shared and static libraries build.
Actions are SHA-pinned, permissions least-privilege, provenance attested.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012kWck3NjBo5orHKAXMHm5W
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
Containerfile+.github/workflows/publish-image.ymlso checky-monkey publishes its own image toghcr.io/hyperpolymath/checky-monkey, and fixes a pre-existing Zig compile error so the library actually builds.Why
Part of the cross-repo GHCR attribution cleanup. The
checky-monkeypackage was mis-attributed toodds-and-sods-package-manager, whose vendored Containerfile built a Rust/axum service that does not exist in this repo. Publishing from here re-links the package to its real source.What the image is
checky-monkey on disk is a Zig C-ABI library (
libchecky_monkey.{so,a}) with Idris2 ABI bindings — not a running service (the Haskell/Servant platform in the README/TOPOLOGY is aspirational and not yet on disk). So the image is a distribution artifact carrying the compiled library (and its source) for downstream FFI consumers toCOPY --from. NoEXPOSE/serviceHEALTHCHECK.Source fix (so it compiles)
ffi/zig/src/main.zig:Handlewas declared asopaque { allocator, initialized }, which Zig rejects — opaque types cannot carry fields. Changed to astruct(still exposed to C only as an opaque*Handlepointer, so the C-ABI is unchanged).zig build-lib src/main.zig ... -lc(libc is required bystd.heap.c_allocator), bypassing the in-treebuild.zig, which is a not-yet-instantiated scaffold template ({{project}}placeholders + a referenced-but-missinginclude/header).Verification
Built locally with Zig 0.13.0: after the
opaque→structfix and-lc, bothlibchecky_monkey.soandlibchecky_monkey.abuild cleanly.🤖 Generated with Claude Code
https://claude.ai/code/session_012kWck3NjBo5orHKAXMHm5W
Generated by Claude Code