Skip to content

Commit

Permalink
Docs build step
Browse files Browse the repository at this point in the history
  • Loading branch information
SnorlaxAssist committed Jun 13, 2024
1 parent ad66024 commit f3a65e3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: actions/configure-pages@v5

- name: Build docs
run: zig build-lib src/lib.zig -fno-emit-bin -femit-docs=docs
run: zig build docs

- name: Archive artifact
shell: sh
Expand Down
19 changes: 19 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,23 @@ pub fn build(b: *std.Build) void {

const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&run_lib_unit_tests.step);

// Docs
const docs_step = b.step("docs", "Build documentation");

const docs_obj = b.addObject(.{
.name = "docs",
.root_source_file = b.path(LIB_SRC),
.target = target,
.optimize = optimize,
});
docs_obj.linkLibrary(lib);
docs_obj.addIncludePath(lz4_dependency.path("lib"));

const install_docs = b.addInstallDirectory(.{
.source_dir = docs_obj.getEmittedDocs(),
.install_dir = .prefix,
.install_subdir = "../docs",
});
docs_step.dependOn(&install_docs.step);
}

0 comments on commit f3a65e3

Please sign in to comment.