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
2 changes: 1 addition & 1 deletion .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
set -euo pipefail
OLD_ESC="${OLD//./\\.}"
sed -i "s/\.version = \"${OLD_ESC}\"/.version = \"${NEW}\"/" build.zig.zon
sed -i "s/${OLD_ESC}/${NEW}/g" website/content/docs/getting-started.smd
sed -i "s/download\/${OLD_ESC}/download\/${NEW}/g" website/content/docs/getting-started.smd
echo "Bumped $OLD -> $NEW"

- name: Commit version bump
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,6 @@ on:
workflow_dispatch:

jobs:
# Ensure that the zig version found in build.zig.zon is present in the readme
readme-version:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- run: |
DOC_FILES="README.md website/content/docs/getting-started.smd"
EXIT_CODE=0
for FILE in $DOC_FILES
do
if ! grep -q $(cat build.zig.zon | sed -n 's/.*\.minimum_zig_version = "\(.*\)",/\1/p') $FILE
then
echo Zig version documented in \'$FILE\' out of sync with build.zig.zon
EXIT_CODE=1
fi
done

exit $EXIT_CODE

lint:
runs-on: ubuntu-latest
permissions:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/readme-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Readme version check

on:
pull_request:
branches: [main]
workflow_dispatch:

jobs:
# Ensure that the zig version found in build.zig.zon is present in the readme
readme-version:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- run: |
DOC_FILES="README.md website/content/docs/getting-started.smd"
EXIT_CODE=0
CURRENT_VERSION=$(cat build.zig.zon | sed -n 's/.*\.minimum_zig_version = "\(.*\)",/\1/p')
echo current version: $CURRENT_VERSION
for FILE in $DOC_FILES
do
if ! grep -q $CURRENT_VERSION $FILE
then
echo Zig version documented in \'$FILE\' out of sync with build.zig.zon
EXIT_CODE=1
fi
done

exit $EXIT_CODE
4 changes: 2 additions & 2 deletions examples/texasinstruments/msp430/build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.{
.name = .msp430,
.name = .mz_examples_ti_msp430,
.version = "0.0.1",
.fingerprint = 0x21359f74332f7448,
.fingerprint = 0x61fb36b73556d6a9,
.dependencies = .{
.microzig = .{ .path = "../../.." },
},
Expand Down
8 changes: 7 additions & 1 deletion tools/release/src/Manifest.zig
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,12 @@ fn parse_dependencies(

for (struct_init.ast.fields) |field_init| {
const name_token = ast.firstToken(field_init) - 2;
const dep_name = try allocator.dupe(u8, ast.tokenSlice(name_token));
const dep_name_raw = ast.tokenSlice(name_token);
const dep_name = try allocator.dupe(u8, if (std.mem.startsWith(u8, dep_name_raw, "@\""))
dep_name_raw[2 .. dep_name_raw.len - 1]
else
dep_name_raw);

errdefer allocator.free(dep_name);

var dep_buf: [2]Ast.Node.Index = undefined;
Expand All @@ -222,6 +227,7 @@ fn parse_dependencies(
for (dep_struct.ast.fields) |dep_field| {
const dep_field_name_token = ast.firstToken(dep_field) - 2;
const dep_field_name = ast.tokenSlice(dep_field_name_token);

if (std.mem.eql(u8, dep_field_name, "path")) {
has_path = true;
path = try parse_string_literal(allocator, ast, dep_field);
Expand Down
2 changes: 1 addition & 1 deletion website/content/docs/getting-started.smd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The main change is in your `build.zig`, where the board target should be
## Let's Begin

Quickly check that you have Zig master. You should see something like
`0.17.3-dev.1936+5a625d5f3` by running `zig version`.
`0.17.0-dev.1936+5a625d5f3` by running `zig version`.

Assuming you've initialized a zig project with `zig init`, or have set one up
yourself, you can add microzig as a dependency with the following command:
Expand Down
Loading