diff --git a/build.zig b/build.zig index 7885db28b8dae1148812daf926e7ebfe65a97e26..5c7c9168f48f8e374e8b0eb8ce71cfd73caea851 100644 --- a/build.zig +++ b/build.zig @@ -10,7 +10,8 @@ pub fn build(b: *Builder) void { const use_full_name = b.option(bool, "use-full-name", "") orelse false; const with_os_arch = b.fmt("-{}-{}", .{@tagName(target.os_tag orelse builtin.os.tag), @tagName(target.cpu_arch orelse builtin.arch)}); - const exe_name = b.fmt("{}{}", .{ "zigmod-zig", if (use_full_name) with_os_arch else "" }); + const version_tag = if (b.option([]const u8, "tag", "")) |vt| b.fmt("-{}", .{vt}) else ""; + const exe_name = b.fmt("{}{}{}", .{ "zigmod-zig", version_tag, if (use_full_name) with_os_arch else "" }); const exe = b.addExecutable(exe_name, "src/main.zig"); exe.setTarget(target); diff --git a/build_all_zig.sh b/build_all_zig.sh index 42c6f5ed2dc16213e532127564d96800dfea00ca..f3ffa8aa0eadcb2b4793710708df4663013e0c9e 100755 --- a/build_all_zig.sh +++ b/build_all_zig.sh @@ -2,8 +2,12 @@ set -e +date=$(date +'%Y.%m.%d') +version=${CIRCLE_BUILD_NUM-$date} +tag=v$version-$(git log --format=%h -1) + for item in $(zig targets | jq --raw-output '.libc[]' | grep gnu$ | grep x86_64) do echo $item - zig build -Dtarget=$item -Drelease -Duse-full-name + zig build -Dtarget=$item -Drelease -Duse-full-name -Dtag=$tag done