Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed Nov 10, 2023
1 parent 5469b7d commit 9e52dbc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
zig-version: ["0.11.0"]
zig-version: ["master"]
targets:
- "x86-windows"
- "x86_64-windows"
Expand All @@ -43,7 +43,7 @@ jobs:
run: |
zig build -Dtarget=${{ matrix.targets }} -Doptimize=ReleaseSafe \
-Dgit_commit=${{ github.head_ref }}-${{ github.sha }} \
-Dbuild_date=${{ env.BUILD_DATE }}
-Dbuild_date=${{ env.BUILD_DATE }} -Dis_ci=true
# https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files
tar -cvf zigcli.tar zig-out/bin/
- name: Upload
Expand All @@ -58,7 +58,7 @@ jobs:
strategy:
fail-fast: false
matrix:
zig-version: ["0.11.0"]
zig-version: ["master"]
targets:
- "x86_64-macos"
- "aarch64-macos"
Expand Down
21 changes: 9 additions & 12 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -170,22 +170,19 @@ fn makeCompileStep(
const name = comptime source.name();
const path = comptime source.path();
if (std.mem.eql(u8, name, "night-shift") or std.mem.eql(u8, name, "dark-mode") or std.mem.eql(u8, name, "pidof")) {
if (target.getOsTag() != .macos) {
// if (target.getOsTag() != .macos) {
if (is_ci) {
// zig build -Dtarget=aarch64-macos will throw error
// error: warning(link): library not found for '-lobjc'
// warning(link): Library search paths:
// warning(link): framework not found for '-framework CoreBrightness'
// warning(link): Framework search paths:
// warning(link): /System/Library/PrivateFrameworks
// so disable this in CI environment.
return null;
}
}

if (is_ci and std.mem.eql(u8, name, "night-shift")) {
// zig build -Dtarget=aarch64-macos will throw error
// error: warning(link): library not found for '-lobjc'
// warning(link): Library search paths:
// warning(link): framework not found for '-framework CoreBrightness'
// warning(link): Framework search paths:
// warning(link): /System/Library/PrivateFrameworks
// so disable this in CI environment.
return null;
}

const exe = b.addExecutable(.{
.name = name,
.root_source_file = .{ .path = path ++ "/" ++ name ++ ".zig" },
Expand Down

0 comments on commit 9e52dbc

Please sign in to comment.