diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/build.zig b/build.zig new file mode 100644 index 0000000..7f8dec1 --- /dev/null +++ b/build.zig @@ -0,0 +1,23 @@ +const std = @import("std"); + +pub fn build(b: *std.Build) void { + const generate_html = b.addExecutable(.{ + .name = "generate_html", + .root_module = b.createModule(.{ + .root_source_file = b.path("util/website.zig"), + .target = b.graph.host, + }), + }); + + const run_generate_html = b.addRunArtifact(generate_html); + run_generate_html.setCwd(b.path("")); // make sure we always run from buildroot + b.getInstallStep().dependOn(&run_generate_html.step); + + const bundle_html = b.addSystemCommand(&[_][]const u8{ "tar", "--exclude=pages.tar.gz", "-czvf", "html-out/pages.tar.gz", "html-out" }); + const run_bundle_html = b.step("bundle", "Creates a tarball of the HTML output"); + bundle_html.step.dependOn(b.getInstallStep()); + run_bundle_html.dependOn(&bundle_html.step); + + const publish_to_prod = b.step("publish", "Publish the website to production"); + _ = publish_to_prod; +} |
