diff --git a/.github/workflows/pkg-release.yml b/.github/workflows/cd.yml similarity index 99% rename from .github/workflows/pkg-release.yml rename to .github/workflows/cd.yml index e7e614f..fcf1de6 100644 --- a/.github/workflows/pkg-release.yml +++ b/.github/workflows/cd.yml @@ -1,4 +1,4 @@ -name: Release Package Artifacts +name: Release on: push: diff --git a/README.md b/README.md index a433d89..324979a 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,13 @@ Temporalz provides Zig bindings to the Rust-based [temporal_rs](https://github.c #### Prerequisites -- Zig 0.16.0-dev.2860+9c5460316 or later +- Zig 0.16.0-dev.2860+9c5460316 - Rust toolchain (only required if [prebuilt staticlibs](#prebuilt) are not available for your platform) #### Add as a Dependency ```bash -zig fetch --save https://github.com/nurulhudaapon/temporalz/archive/main.tar.gz +zig fetch --save git+https://github.com/nurulhudaapon/temporalz.git ``` #### Use in build.zig @@ -53,13 +53,18 @@ exe.root_module.addImport("temporalz", temporalz.module("temporalz")); Prebuilt libraries are included for the following platforms: -- `aarch64-macos` - `x86_64-macos` -- `aarch64-linux-gnu` +- `aarch64-macos` - `x86_64-linux-gnu` +- `aarch64-linux-gnu` - `x86_64-windows-gnu` - `aarch64-windows-gnu` - `wasm32-freestanding` +- `wasm32-wasi` +- `x86_64-linux-musl` +- `aarch64-linux-musl` +- `aarch64-linux-android` +- `aarch64-ios` For other platforms, the library will build from source; you need the Rust toolchain installed. diff --git a/build.zig b/build.zig index 1b1ac7c..a6507eb 100644 --- a/build.zig +++ b/build.zig @@ -21,7 +21,7 @@ pub fn build(b: *std.Build) !void { mod.addIncludePath(temporal_rs_git.path("temporal_capi/bindings/c")); // -- Pre-built library support for temporal_capi --- // - const libtemporal = b.lazyDependency("libtemporal", .{}); + const libtemporal_prebuilt = b.lazyDependency("libtemporal_prebuilt", .{}); // --- Rust C ABI: Library --- // { @@ -42,7 +42,7 @@ pub fn build(b: *std.Build) !void { const prebuilt_lib_path = b.fmt("{s}/{s}", .{ target_triple, lib_name }); var prebuilt_lib_file: ?std.Build.LazyPath = null; - if (libtemporal) |dep| { + if (libtemporal_prebuilt) |dep| { const lib_file_candidate = dep.path(prebuilt_lib_path); const lib_full_path = lib_file_candidate.getPath(b); if (std.Io.Dir.cwd().openFile(b.graph.io, lib_full_path, .{})) |lib_check_file| { @@ -53,17 +53,14 @@ pub fn build(b: *std.Build) !void { if (prebuilt_lib_file) |lib_file| { // Use pre-built library (no Rust compiler needed) - std.debug.print("Using pre-built temporal_capi library from downloaded artifact at: {s}\n", .{prebuilt_lib_path}); mod.addObjectFile(lib_file); } else { - std.debug.print("building from source: {s}\n", .{prebuilt_lib_path}); - // Build from source using the local temporal-rs package - const temporal_rs_local = b.dependency("temporal_rs_local", .{ + const libtemporal_src = b.dependency("libtemporal_src", .{ .target = target, .optimize = optimize, }); - mod.addImport("temporal_rs", temporal_rs_local.module("temporal_rs")); + mod.addImport("temporal_rs", libtemporal_src.module("temporal_rs")); } // --- Rust Misc Deps --- // diff --git a/build.zig.zon b/build.zig.zon index 986c44c..e2e61fd 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -8,12 +8,12 @@ .url = "git+https://github.com/boa-dev/temporal#v0.1.2", .hash = "N-V-__8AANlkNAB77Z946lqp-lgp2qSsOBDADValZC86PhB-", }, - .temporal_rs_local = .{ + .libtemporal_src = .{ .path = "pkg/temporal-rs", }, - .libtemporal = .{ - .url = "https://github.com/nurulhudaapon/temporalz/releases/download/v0.0.1/temporal-rs-libs.tar.gz", - .hash = "N-V-__8AAPJZzwPipYB8PoJ0LhTO9ipHbtbXbTfRuSYbJFtD", + .libtemporal_prebuilt = .{ + .url = "https://github.com/nurulhudaapon/temporalz/releases/download/v0.1.2/temporal-rs-libs.tar.gz", + .hash = "N-V-__8AALzG2AXNSf7E7iuZWx7SrTN0PICWYwnu2kIDlf-w", }, }, .paths = .{