Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,25 @@ jobs:
- name: Build static library
run: zig build -Doptimize=ReleaseFast

autodoc:
name: Autodoc
runs-on: macos-15
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
use-cache: false
- name: Generate autodoc
run: zig build docs
- name: Upload autodoc artifact
uses: actions/upload-artifact@v4
with:
name: autodoc
path: zig-out/docs/
Comment thread
greptile-apps[bot] marked this conversation as resolved.

secrets-scan:
name: Secrets scan
runs-on: ubuntu-latest
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
push:
tags: ['v*']

permissions:
contents: write

jobs:
release:
name: Create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
use-cache: false
- name: Install libsecret (Linux)
run: sudo apt-get install -y libsecret-1-dev libglib2.0-dev
- name: Build release
run: zig build -Doptimize=ReleaseFast
- name: Run tests
run: zig build test
Comment thread
greptile-apps[bot] marked this conversation as resolved.
- name: Generate autodoc
run: zig build docs

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Generated autodoc is silently discarded

zig build docs runs and writes output to zig-out/docs/, but there is no subsequent step to do anything with it — no upload-artifact, no GitHub Pages deployment, and the files are not added to the release assets. The CI autodoc job correctly follows the same step with actions/upload-artifact@v4; the release workflow has no equivalent. If the intent is to publish docs on a release (e.g., to GitHub Pages or as a release attachment), the step currently produces output that is immediately thrown away.

Comment on lines +27 to +28

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 zig build docs will abort every release

The release workflow runs on ubuntu-latest (Linux), and docs_mod lacks the Linux-specific native library setup (include path, C source file, and linkSystemLibrary calls required on Linux). Unlike the CI autodoc job (which has continue-on-error: true), this step has no error-tolerance flag, so it will fail and abort the entire release job before the tarball or GitHub Release is ever created. Until docs_mod is fully wired up for Linux, either add continue-on-error: true to this step or remove it from the release workflow.

- name: Create source tarball
run: |
VERSION=${GITHUB_REF#refs/tags/}
git archive --format=tar.gz --prefix=zig-keychain-${VERSION}/ HEAD > zig-keychain-${VERSION}.tar.gz
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
zig-keychain-*.tar.gz
12 changes: 7 additions & 5 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ pub fn build(b: *std.Build) void {

// Documentation generation
const docs_step = b.step("docs", "Generate API documentation");
const docs_mod = b.createModule(.{
.root_source_file = b.path("src/ffi.zig"),
.target = target,
.optimize = optimize,
});
docs_mod.link_libc = true;
const docs_lib = b.addLibrary(.{
.name = "zig-keychain",
.root_module = b.createModule(.{
.root_source_file = b.path("src/ffi.zig"),
.target = target,
.optimize = optimize,
}),
.root_module = docs_mod,
.linkage = .static,
});
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Comment on lines +54 to 64

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 docs_mod missing macOS framework linking

root_module conditionally links Security and CoreFoundation on macOS (lines 31–33), but docs_mod only sets link_libc = true. The CI autodoc job runs on macos-15, so zig build docs will try to compile src/ffi.zig (which ultimately pulls in macOS keychain code referencing those frameworks) and fail with unresolved symbol errors. The continue-on-error: true on the job masks this failure, so no docs artifact is ever produced.

    docs_mod.link_libc = true;
    if (resolved_target.result.os.tag == .macos) {
        docs_mod.linkFramework("Security", .{});
        docs_mod.linkFramework("CoreFoundation", .{});
    }

const install_docs = b.addInstallDirectory(.{
Expand Down
Loading