Skip to content

Commit

Permalink
post(how-to-release-your-zig-applications): update example code to 0.…
Browse files Browse the repository at this point in the history
…12.0 (#31)

Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 authored May 25, 2024
1 parent 9c0dd8f commit 00ab5c9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
zig: [0.11.0]
zig: [0.12.0]
steps:
- uses: actions/checkout@v4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ date: "2024-01-12T12:04:50-0500"
---

> - 原文链接: https://zig.news/kristoff/how-to-release-your-zig-applications-2h90
> - API 适配到 Zig 0.11.0 版本
> - API 适配到 Zig 0.12.0 版本
> - 本文配套代码在[这里](https://github.com/zigcc/zigcc.github.io/tree/main/examples/20240112)找到
你刚用 Zig 写了一个应用程序,并希望其他人使用它。
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
zig 0.11.0
zig 0.12.0
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const strip = b.option(bool, "strip", "Set to true to strip binary") orelse false;

const exe = b.addExecutable(.{
.name = "example",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
.strip = strip,
});
exe.strip = strip;

b.installArtifact(exe);

const run_cmd = b.addRunArtifact(exe);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.{
.name = "2024-01-12-how-to-release-your-zig-applications",
.version = "0.0.0",
.dependencies = .{},
.paths = .{
"",
},
}

0 comments on commit 00ab5c9

Please sign in to comment.