Add autodoc CI job and release workflow#3
Conversation
Greptile SummaryThis PR adds an Confidence Score: 3/5Not safe to merge as-is — the release docs step will fail on Linux and the autodoc CI job silently swallows failures Two pre-existing P1 findings (in prior threads) remain unaddressed:
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A([push to main or PR]) --> B[CI build job\nmacos-15 and ubuntu-latest]
A --> C[CI autodoc job\nmacos-15]
A --> D[CI secrets-scan\nubuntu-latest]
C --> E{zig build docs}
E -->|success| F[upload-artifact: autodoc]
E -->|failure| G[job fails silently\ncontinue-on-error=true\nartifact skipped]
H([push v-star tag]) --> I[release workflow\nubuntu-latest]
I --> J[Install libnotify deps]
J --> K[zig build ReleaseFast]
K --> L[zig build test]
L --> M{zig build docs\nmissing include paths}
M -->|Linux fails| N[workflow aborts]
M -->|success| O[git archive tarball]
O --> P[action-gh-release\ncontents write\nunpinned tag]
P --> Q([GitHub Release\ntarball only\nno docs asset])
Reviews (4): Last reviewed commit: "Run autodoc on macOS with continue-on-er..." | Re-trigger Greptile |
| VERSION=${GITHUB_REF#refs/tags/} | ||
| git archive --format=tar.gz --prefix=zig-notify-${VERSION}/ HEAD > zig-notify-${VERSION}.tar.gz | ||
|
|
||
| - name: Create GitHub Release |
There was a problem hiding this comment.
Third-party action pinned to a mutable tag with
contents: write
softprops/action-gh-release@v2 is a semver tag, not a commit SHA. With permissions: contents: write at the workflow level, any future movement or compromise of that tag would run untrusted code with write access to this repository. Pin to the current commit SHA of v2 instead.
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@da356b9ba7a48dd4b9c8cb80e72e1dff1e7cfe47 # v2 |
| run: | | ||
| VERSION=${GITHUB_REF#refs/tags/} | ||
| git archive --format=tar.gz --prefix=zig-notify-${VERSION}/ HEAD > zig-notify-${VERSION}.tar.gz | ||
|
|
||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| generate_release_notes: true | ||
| files: | | ||
| zig-notify-*.tar.gz |
There was a problem hiding this comment.
Autodoc generated but not included in release assets
zig build docs is executed and writes to zig-out/docs/, but that output is never referenced in files: — only the source tarball is uploaded to the GitHub Release. If distributing HTML docs with each release is intentional, the docs directory needs to be packaged and added to files:.
| const docs_mod = b.createModule(.{ | ||
| .root_source_file = b.path("src/ffi.zig"), | ||
| .target = target, | ||
| .optimize = optimize, | ||
| }); | ||
| docs_mod.link_libc = true; |
There was a problem hiding this comment.
docs_mod missing system include paths —
zig build docs will fail on Linux
docs_mod sets link_libc = true but omits the addSystemIncludePath calls that root_module adds for libnotify/glib/gdk-pixbuf. Because ffi.zig → notify.zig → notify_linux.zig contains @cImport({ @cInclude("libnotify/notify.h") }), the compiler must resolve that header during doc generation. Without the include paths, this will produce a "file not found" error in both the CI autodoc job and the release workflow on Linux.
| const docs_mod = b.createModule(.{ | |
| .root_source_file = b.path("src/ffi.zig"), | |
| .target = target, | |
| .optimize = optimize, | |
| }); | |
| docs_mod.link_libc = true; | |
| const docs_mod = b.createModule(.{ | |
| .root_source_file = b.path("src/ffi.zig"), | |
| .target = target, | |
| .optimize = optimize, | |
| }); | |
| docs_mod.link_libc = true; | |
| if (resolved_target.result.os.tag == .linux) { | |
| docs_mod.addSystemIncludePath(.{ .cwd_relative = "/usr/include/libnotify" }); | |
| docs_mod.addSystemIncludePath(.{ .cwd_relative = "/usr/include/glib-2.0" }); | |
| docs_mod.addSystemIncludePath(.{ .cwd_relative = "/usr/include/gdk-pixbuf-2.0" }); | |
| docs_mod.addSystemIncludePath(.{ .cwd_relative = "/usr/lib/x86_64-linux-gnu/glib-2.0/include" }); | |
| docs_mod.addSystemIncludePath(.{ .cwd_relative = "/usr/lib/aarch64-linux-gnu/glib-2.0/include" }); | |
| docs_mod.addSystemIncludePath(.{ .cwd_relative = "/usr/lib64/glib-2.0/include" }); | |
| docs_mod.addSystemIncludePath(.{ .cwd_relative = "/usr/lib/glib-2.0/include" }); | |
| } |
Summary
autodocjob to CI that generates and uploads API docs as an artifact on every push/PRrelease.ymlworkflow triggered onv*tags: builds ReleaseFast, runs tests, generates autodoc, creates source tarball, and publishes a GitHub Release viasoftprops/action-gh-release@v2docsbuild step from Phase 1; no build.zig changes neededTest plan
v0.x.ytag after merge to verify release workflow creates a GitHub Release with tarball