authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-14 19:53:52 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-14 19:53:52 -08:00
logf50a5fbde5b5f9161b323239de3ab00072609f2a
treea3ef3b80a23d0873913464d9c9220068bedb43e5
parent575a2e7e6cd372d335e4227a0bd15cc416e78cbf

add version tag to build_all_zig


2 files changed, 7 insertions(+), 2 deletions(-)

build.zig+2-1
...@@ -10,7 +10,8 @@ pub fn build(b: *Builder) void {...@@ -10,7 +10,8 @@ pub fn build(b: *Builder) void {
1010
11 const use_full_name = b.option(bool, "use-full-name", "") orelse false;11 const use_full_name = b.option(bool, "use-full-name", "") orelse false;
12 const with_os_arch = b.fmt("-{}-{}", .{@tagName(target.os_tag orelse builtin.os.tag), @tagName(target.cpu_arch orelse builtin.arch)});12 const with_os_arch = b.fmt("-{}-{}", .{@tagName(target.os_tag orelse builtin.os.tag), @tagName(target.cpu_arch orelse builtin.arch)});
13 const exe_name = b.fmt("{}{}", .{ "zigmod-zig", if (use_full_name) with_os_arch else "" });13 const version_tag = if (b.option([]const u8, "tag", "")) |vt| b.fmt("-{}", .{vt}) else "";
14 const exe_name = b.fmt("{}{}{}", .{ "zigmod-zig", version_tag, if (use_full_name) with_os_arch else "" });
1415
15 const exe = b.addExecutable(exe_name, "src/main.zig");16 const exe = b.addExecutable(exe_name, "src/main.zig");
16 exe.setTarget(target);17 exe.setTarget(target);
build_all_zig.sh+5-1
...@@ -2,8 +2,12 @@...@@ -2,8 +2,12 @@
22
3set -e3set -e
44
5date=$(date +'%Y.%m.%d')
6version=${CIRCLE_BUILD_NUM-$date}
7tag=v$version-$(git log --format=%h -1)
8
5for item in $(zig targets | jq --raw-output '.libc[]' | grep gnu$ | grep x86_64)9for item in $(zig targets | jq --raw-output '.libc[]' | grep gnu$ | grep x86_64)
6do10do
7 echo $item11 echo $item
8 zig build -Dtarget=$item -Drelease -Duse-full-name12 zig build -Dtarget=$item -Drelease -Duse-full-name -Dtag=$tag
9done13done