From 3ce11125308d2fa61be4fd05fa39036aec8e39b9 Mon Sep 17 00:00:00 2001 From: Jess Sullivan Date: Sat, 25 Apr 2026 14:10:51 -0400 Subject: [PATCH 1/4] Add autodoc CI job and release workflow --- .github/workflows/ci.yml | 18 ++++++++++++++++++ .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15e335a..da37d6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,24 @@ jobs: - name: Build static library run: zig build -Doptimize=ReleaseFast + autodoc: + name: Autodoc + 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: Generate autodoc + run: zig build docs + - name: Upload autodoc artifact + uses: actions/upload-artifact@v4 + with: + name: autodoc + path: zig-out/docs/ + secrets-scan: name: Secrets scan runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..da5675d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +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: Build release + run: zig build -Doptimize=ReleaseFast + - name: Run tests + run: zig build test + - name: Generate autodoc + run: zig build docs + - 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 From 18b128f6a7abcb43ca09bc2c041819568bc0026b Mon Sep 17 00:00:00 2001 From: Jess Sullivan Date: Sat, 25 Apr 2026 14:15:48 -0400 Subject: [PATCH 2/4] Fix: install libsecret-1-dev for autodoc and release jobs --- .github/workflows/ci.yml | 2 ++ .github/workflows/release.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da37d6e..b5e6157 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,8 @@ jobs: 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: Generate autodoc run: zig build docs - name: Upload autodoc artifact diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da5675d..48c8c2c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,8 @@ jobs: 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 From 3daf7a1deda2064fe59a749667d8ada5974a1f76 Mon Sep 17 00:00:00 2001 From: Jess Sullivan Date: Sat, 25 Apr 2026 14:23:49 -0400 Subject: [PATCH 3/4] Fix: link libc in docs library for @cImport support --- build.zig | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build.zig b/build.zig index 0a0bd3c..b0dcec5 100644 --- a/build.zig +++ b/build.zig @@ -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, }); const install_docs = b.addInstallDirectory(.{ From 4265de2a49589785fdec869bf6ae4f5ff826bc27 Mon Sep 17 00:00:00 2001 From: Jess Sullivan Date: Sat, 25 Apr 2026 14:31:34 -0400 Subject: [PATCH 4/4] Run autodoc on macOS with continue-on-error --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5e6157..c95c737 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,8 @@ jobs: autodoc: name: Autodoc - runs-on: ubuntu-latest + runs-on: macos-15 + continue-on-error: true steps: - uses: actions/checkout@v4 - name: Install Zig @@ -43,8 +44,6 @@ jobs: 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: Generate autodoc run: zig build docs - name: Upload autodoc artifact