Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,21 @@ jobs:
- name: Build Website
run: zig build
working-directory: website

package-dry-run:
name: Package Dry Run
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Setup Zig
uses: mlugg/setup-zig@v2

- run: zig build -Doptimize=ReleaseSafe
working-directory: ./tools/release

- name: Assemble Packages
run: ./tools/release/zig-out/bin/release -- https://github.com/ZigEmbeddedGroup/microzig/releases/download
11 changes: 6 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ jobs:

- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: master

- run: zig build -Doptimize=ReleaseSafe
working-directory: ./tools/release

- name: Extract version
run: echo "MICROZIG_VERSION=$(zig build package -- get-version)" >> $GITHUB_ENV
run: echo "MICROZIG_VERSION=$(./tools/release/zig-out/bin/release get-version)" >> $GITHUB_ENV

- name: Assemble Packages
run: zig build package -- https://github.com/ZigEmbeddedGroup/microzig/releases/download
run: ./tools/release/zig-out/bin/release -- https://github.com/ZigEmbeddedGroup/microzig/releases/download

- name: Create Release Draft
uses: ncipollo/release-action@v1
Expand All @@ -39,4 +40,4 @@ jobs:
artifactErrorsFailBuild: true
draft: true
generateReleaseNotes: true
artifacts: boxzer-out/${{ env.MICROZIG_VERSION }}/*
artifacts: release-out/${{ env.MICROZIG_VERSION }}/*
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ __pycache__/
.lldbinit
.venv
.zig-cache/
boxzer-out
release-out
microzig-deploy/
zig-cache/
zig-out/
Expand Down
28 changes: 4 additions & 24 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.name = .microzig,
// Note: This should be changed if you fork microzig!
.fingerprint = 0x605a83a849186d0f,
.version = "0.15.2",
.version = "0.17.0",
.minimum_zig_version = "0.17.0-dev.1936+5a625d5f3",
.dependencies = .{
.@"build-internals" = .{ .path = "build-internals" },
Expand All @@ -11,24 +11,9 @@

// tools
.@"tools/esp-image" = .{ .path = "tools/esp-image" },
.@"tools/printer" = .{ .path = "tools/printer" },
.@"tools/regz" = .{ .path = "tools/regz" },
.@"tools/uf2" = .{ .path = "tools/uf2" },
.@"tools/dfu" = .{ .path = "tools/dfu" },
.@"tools/flags" = .{ .path = "tools/flags" },

// modules
.@"modules/bounded-array" = .{ .path = "modules/bounded-array" },
.@"modules/foundation-libc" = .{ .path = "modules/foundation-libc" },
.@"modules/freertos" = .{ .path = "modules/freertos" },
.@"modules/lwip" = .{ .path = "modules/lwip" },
.@"modules/network" = .{ .path = "modules/network" },
.@"modules/riscv32-common" = .{ .path = "modules/riscv32-common" },
.@"modules/rtt" = .{ .path = "modules/rtt" },
.@"modules/virtual-io" = .{ .path = "modules/virtual-io" },

// simulators
.@"sim/aviron" = .{ .path = "sim/aviron", .lazy = true },

// ports
.@"port/espressif/esp" = .{ .path = "port/espressif/esp", .lazy = true },
Expand All @@ -45,20 +30,15 @@
.@"port/texasinstruments/mspm0" = .{ .path = "port/texasinstruments/mspm0", .lazy = true },
.@"port/texasinstruments/tm4c" = .{ .path = "port/texasinstruments/tm4c", .lazy = true },
.@"port/wch/ch32v" = .{ .path = "port/wch/ch32v", .lazy = true },

.@"modules/riscv32-common" = .{ .path = "modules/riscv32-common" },
.@"modules/rtt" = .{ .path = "modules/rtt" },
},
.paths = .{
"README.md",
"build.zig",
"build.zig.zon",
"LICENSE",
"design",
"tools/generate_linker_script.zig",
"tools",
"port",
"examples",
"build-internals",
"core",
"drivers",
"modules",
},
}
10 changes: 1 addition & 9 deletions drivers/build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
.paths = .{
"build.zig",
"build.zig.zon",
"framework.zig",
"base",
"display",
"input",
"io_expander",
"led",
"sensor",
"stepper",
"wireless",
"src",
},
}
1 change: 0 additions & 1 deletion examples/raspberrypi/rp2xxx/build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
"build.zig",
"build.zig.zon",
"src",
"scripts",
},
}
1 change: 0 additions & 1 deletion examples/texasinstruments/tm4c/build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
.microzig = .{ .path = "../../.." },
},
.paths = .{
"README.md",
"build.zig",
"build.zig.zon",
"src",
Expand Down
4 changes: 2 additions & 2 deletions modules/riscv32-common/build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.{
.name = .riscv32common,
.fingerprint = 0xde1ed91db6b5dcf9,
.name = .riscv32_common,
.fingerprint = 0x638e68c0bbf65ffa,
.version = "0.0.0",
.paths = .{
"README.md",
Expand Down
1 change: 0 additions & 1 deletion tools/flags/build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
.version = "0.0.1",
.fingerprint = 0xa32e1a54c66c4a49,
.paths = .{
"README.md",
"build.zig",
"build.zig.zon",
"src",
Expand Down
4 changes: 4 additions & 0 deletions tools/release/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# MicroZig release

This tool takes MicroZig's monorepo and regenerates all the sub-packages into
their own tarballs for a release.
49 changes: 49 additions & 0 deletions tools/release/build.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
const std = @import("std");

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

const release_mod = b.addModule("release", .{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});

const release_exe = b.addExecutable(.{
.name = "release",
.root_module = release_mod,
});
b.installArtifact(release_exe);

const run_cmd = b.addRunArtifact(release_exe);
run_cmd.step.dependOn(b.getInstallStep());
run_cmd.addPassthruArgs();

const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);

const exe_unit_tests = b.addTest(.{
.root_module = release_mod,
});

const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests);
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&run_exe_unit_tests.step);

// Integration tests that verify hash compatibility with zig fetch
const hash_test_mod = b.addModule("hash_test", .{
.root_source_file = b.path("src/hash_test.zig"),
.target = target,
.optimize = optimize,
});

const hash_tests = b.addTest(.{
.root_module = hash_test_mod,
});

const run_hash_tests = b.addRunArtifact(hash_tests);
const integration_test_step = b.step("test-integration", "Run integration tests (requires zig on PATH)");
integration_test_step.dependOn(&run_hash_tests.step);
test_step.dependOn(&run_hash_tests.step);
}
17 changes: 17 additions & 0 deletions tools/release/build.zig.zon
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.{
.name = .mz_tools_release,
.version = "0.1.0",
.fingerprint = 0xa203fd280ac79711,
.paths = .{
"build.zig",
"build.zig.zon",
"README.md",
"src",
},
.release_ignores = .{
"test/monorepo",
"test/monorepo/b",
"test/monorepo/c",
"test/workbench/a",
},
}
15 changes: 15 additions & 0 deletions tools/release/scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

set -eu

cd test/monorepo
../../zig-out/bin/release http://localhost:8000
python3 -m http.server 8000 --directory release-out &
sleep 1

cd ../workbench/a
../../../../zig/build/stage3/bin/zig fetch --save=b http://localhost:8000/0.0.0/b.tar.gz
zig build

# clean up server
jobs -p | xargs kill
Loading
Loading