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/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Thank you for your interest in contributing to Craft! This document provides gui

### Prerequisites

- **Pantry-managed stable Zig**: run `eval "$(pantry env | sed -n '/^export /,$p')"`, then invoke `zig`
- **Pantry-managed stable Zig**: run `eval "$(pantry env | sed -n '/^export /,$p')"`, then invoke `zig` (locally only — CI does not: the pantry action already puts `zig` on PATH, and `pantry env` runs a workspace setup that re-installs JS deps with its own `--linker`, rewriting `node_modules` mid-job)
- **Bun**: Install from [bun.sh](https://bun.sh)

#### Platform-specific Dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Build binary
working-directory: packages/zig
run: |
eval "$(pantry env | sed -n '/^export /,$p')" && zig build -Doptimize=ReleaseFast
zig build -Doptimize=ReleaseFast
mkdir -p "$RUNNER_TEMP/bench"
cp zig-out/bin/craft "$RUNNER_TEMP/bench/craft-head"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/binary-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Build release binary
working-directory: packages/zig
run: |
eval "$(pantry env | sed -n '/^export /,$p')" && zig build -Doptimize=ReleaseSafe
zig build -Doptimize=ReleaseSafe

- name: Measure binary size
id: size
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
git checkout origin/main -- packages/zig

cd packages/zig
eval "$(pantry env | sed -n '/^export /,$p')" && zig build -Doptimize=ReleaseSafe
zig build -Doptimize=ReleaseSafe

if [ -f "zig-out/bin/craft" ]; then
BASELINE=$(wc -c < "zig-out/bin/craft" | tr -d ' ')
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64

- name: Verify Zig installation
run: eval "$(pantry env | sed -n '/^export /,$p')" && zig version
run: zig version

- name: Cache Zig artifacts
uses: actions/cache@v5
Expand All @@ -58,14 +58,14 @@ jobs:

- name: Build Zig core
working-directory: packages/zig
run: eval "$(pantry env | sed -n '/^export /,$p')" && zig build
run: zig build

- name: First-party Zig dependencies
uses: ./.github/actions/first-party-zig-deps

- name: Test Zig core
working-directory: packages/zig
run: eval "$(pantry env | sed -n '/^export /,$p')" && zig build test
run: zig build test

- name: Check binary size
if: runner.os == 'Linux'
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:

- name: Check Zig formatting
working-directory: packages/zig
run: eval "$(pantry env | sed -n '/^export /,$p')" && zig fmt --check src/ build.zig
run: zig fmt --check src/ build.zig

- name: Audit Zig C imports
run: bun run verify:cimports
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:

- name: Build Zig core
working-directory: packages/zig
run: eval "$(pantry env | sed -n '/^export /,$p')" && zig build
run: zig build

- name: Build TypeScript SDK
working-directory: packages/typescript
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/mobile-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
run: |
# Build iOS simulator static libraries using dedicated build step
# (not the default target which builds macOS executables)
eval "$(pantry env | sed -n '/^export /,$p')" && zig build build-ios-simulator -Doptimize=ReleaseSafe -Dmacos-sdk="$(xcrun --sdk iphonesimulator --show-sdk-path)"
zig build build-ios-simulator -Doptimize=ReleaseSafe -Dmacos-sdk="$(xcrun --sdk iphonesimulator --show-sdk-path)"

- name: First-party Zig dependencies
uses: ./.github/actions/first-party-zig-deps
Expand All @@ -85,7 +85,7 @@ jobs:
# `zig build test` reports through its exit code. The old form piped
# it to a file and grepped for "mobile"/"ios", which fails under
# `set -e` whenever the run is clean and the file is therefore empty.
eval "$(pantry env | sed -n '/^export /,$p')" && zig build test
zig build test

- name: Build iOS test app
if: hashFiles('packages/ios/TestApp/TestApp.xcodeproj') != ''
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
# builds the desktop binaries — and since an android triple reports
# os_tag == .linux, that links GTK3/WebKit2GTK against a sysroot that
# does not exist for Android.
eval "$(pantry env | sed -n '/^export /,$p')" && zig build build-android -Doptimize=ReleaseSafe
zig build build-android -Doptimize=ReleaseSafe

- name: First-party Zig dependencies
uses: ./.github/actions/first-party-zig-deps
Expand All @@ -187,7 +187,7 @@ jobs:
# `zig build test` reports through its exit code. The old form piped
# it to a file and grepped for "mobile"/"android", which fails under
# `set -e` whenever the run is clean and the file is therefore empty.
eval "$(pantry env | sed -n '/^export /,$p')" && zig build test
zig build test

- name: Enable KVM
run: |
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
mkdir -p zig-out/cross

echo "::group::Cross-compile darwin-x64"
eval "$(pantry env | sed -n '/^export /,$p')" && zig build -Doptimize=ReleaseSafe -Dversion="$VERSION" -Dtarget="$X64_TARGET" -Dmacos-sdk="$SDK_PATH"
zig build -Doptimize=ReleaseSafe -Dversion="$VERSION" -Dtarget="$X64_TARGET" -Dmacos-sdk="$SDK_PATH"
mkdir -p zig-out/cross/darwin-x64 && cp zig-out/bin/craft zig-out/cross/darwin-x64/craft
echo "::endgroup::"

Expand All @@ -87,7 +87,7 @@ jobs:
# cross-compilation mode, where it stops looking for the system SDK
# on its own and every `-framework Cocoa` fails to resolve.
rm -rf zig-out/bin
eval "$(pantry env | sed -n '/^export /,$p')" && zig build -Doptimize=ReleaseSafe -Dversion="$VERSION" -Dtarget="$ARM64_TARGET" -Dmacos-sdk="$SDK_PATH"
zig build -Doptimize=ReleaseSafe -Dversion="$VERSION" -Dtarget="$ARM64_TARGET" -Dmacos-sdk="$SDK_PATH"

# AppKit decides how it draws a window's controls from the SDK recorded
# in LC_BUILD_VERSION, so that it can restyle them without restyling
Expand Down Expand Up @@ -144,7 +144,6 @@ jobs:
"x86_64-windows:windows-x64:craft.exe"; do
IFS=: read -r zig_target dir_name bin_name <<< "$target_spec"
echo "::group::Cross-compile $dir_name"
eval "$(pantry env | sed -n '/^export /,$p')"
zig build -Doptimize=ReleaseSafe -Dversion="$VERSION" -Dtarget="$zig_target"
mkdir -p "zig-out/cross/$dir_name" && cp "zig-out/bin/$bin_name" "zig-out/cross/$dir_name/$bin_name"
echo "Built $dir_name"
Expand All @@ -157,7 +156,7 @@ jobs:
# so craft-linux-x64.zip shipped a Windows PE binary alongside the
# Linux one.
rm -rf zig-out/bin
eval "$(pantry env | sed -n '/^export /,$p')" && zig build -Doptimize=ReleaseSafe -Dversion="$VERSION"
zig build -Doptimize=ReleaseSafe -Dversion="$VERSION"

# ── macOS Code Signing & Notarization ──────────────────────────
# The signing credentials live encrypted in `.env.production`, not as
Expand Down
Loading