Skip to content

Installation

Requirements

  • Zig: 0.15.0 or later
  • Network: Access required only when checking is enabled

The easiest way to install updater.zig is using Zig's built-in package manager:

bash
zig fetch --save https://github.com/muhammad-fiaz/updater.zig/archive/refs/tags/0.0.1.tar.gz

This automatically adds the dependency to your build.zig.zon.

Configure build.zig

Add the module to your build configuration:

zig
const std = @import("std");

pub fn build(b: *std.Build) void {
    const target = b.standardTargetOptions(.{});
    const optimize = b.standardOptimizeOption(.{});

    // Add updater.zig dependency
    const updater_dep = b.dependency("updater", .{
        .target = target,
        .optimize = optimize,
    });

    // Create your executable
    const exe = b.addExecutable(.{
        .name = "my-app",
        .root_source_file = b.path("src/main.zig"),
        .target = target,
        .optimize = optimize,
    });

    // Add updater module
    exe.root_module.addImport("updater", updater_dep.module("updater"));

    b.installArtifact(exe);
}

Manual Installation

If you prefer manual installation, add to build.zig.zon:

zig
.dependencies = .{
    .updater = .{
        .url = "https://github.com/muhammad-fiaz/updater.zig/archive/refs/tags/0.0.1.tar.gz",
        .hash = "YOUR_HASH_HERE",
    },
},

Get the hash:

bash
zig fetch --hash https://github.com/muhammad-fiaz/updater.zig/archive/refs/tags/0.0.1.tar.gz

Verify Installation

Run your tests to verify installation:

bash
zig build test

Build Options

updater.zig supports these build options:

OptionTypeDefaultDescription
enable_update_checkbooltrueEnable/disable update checking
targetTargetnativeCross-compilation target
optimizeOptimizeDebugOptimization level

Next Steps

Released under the MIT License.