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
21 changes: 21 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ jobs:
extra_nix_config: |
experimental-features = nix-command flakes

- name: Import code-signing certificate
if: ${{ secrets.MACOS_CERTIFICATE != '' && secrets.MACOS_CERTIFICATE_PWD != '' }}
uses: Apple-Actions/import-codesign-certs@v6
with:
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }}
p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }}

- name: Cache Nix store
uses: cachix/cachix-action@v16
with:
Expand All @@ -50,6 +57,20 @@ jobs:
run: |
chmod +x scripts/bundle-macos.sh
./scripts/bundle-macos.sh zig-out/bin/architect release
if security find-identity -v -p codesigning >/tmp/codesign-identities.txt 2>/dev/null; then
IDENTITY=$(awk 'NR==1 {print $2}' /tmp/codesign-identities.txt)
echo "Signing with identity ${IDENTITY}"
for lib in release/lib/*.dylib; do
codesign --force --options runtime --timestamp --sign "$IDENTITY" "$lib"
Comment thread
forketyfork marked this conversation as resolved.
done
codesign --force --options runtime --timestamp --sign "$IDENTITY" release/architect.bin
else
echo "No Developer ID cert available; applying ad-hoc signature for Gatekeeper"
for lib in release/lib/*.dylib; do
codesign --force --sign - "$lib"
done
codesign --force --sign - release/architect.bin
fi
cd release
tar -czf architect-macos-${{ matrix.arch }}.tar.gz *
working-directory: architect
Expand Down
10 changes: 9 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
const std = @import("std");

pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
// GitHub's macOS runners default the deployment target to the host
// (currently 15.x), which makes release binaries fail to start on older
// macOS versions. Pin a lower default; callers can still override with
// -Dtarget.
const target = b.standardTargetOptions(.{
.default_target = .{
.os_version_min = .{ .semver = .{ .major = 12, .minor = 0, .patch = 0 } },
},
});
const optimize = b.standardOptimizeOption(.{});

const exe_mod = b.createModule(.{
Expand Down