Update Claude ACP runtime to 0.34.0 #58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Electron Package Smoke | |
| on: | |
| pull_request: | |
| paths: | |
| - apps/desktop/package.json | |
| - apps/desktop/package-lock.json | |
| - apps/desktop/electron-builder.config.mjs | |
| - apps/desktop/electron.vite.config.ts | |
| - apps/desktop/build/** | |
| - apps/desktop/embedded/** | |
| - apps/desktop/scripts/** | |
| - apps/desktop/src-electron/** | |
| - apps/desktop/native-backend/** | |
| - vendor/codex-acp/** | |
| - vendor/Claude-agent-acp-upstream/** | |
| - .github/workflows/electron-package-smoke.yml | |
| - .github/workflows/release-desktop.yml | |
| workflow_dispatch: | |
| concurrency: | |
| group: electron-package-smoke-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| macos-universal: | |
| name: macOS Universal | |
| runs-on: macos-latest | |
| timeout-minutes: 120 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: apps/desktop/package-lock.json | |
| - name: Setup Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-apple-darwin,x86_64-apple-darwin | |
| - name: Cache Rust build outputs | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install desktop dependencies | |
| working-directory: apps/desktop | |
| run: npm ci | |
| - name: Build target-specific sidecars | |
| shell: bash | |
| run: | | |
| cargo build -p neverwrite-native-backend --quiet --release --target aarch64-apple-darwin | |
| cargo build -p neverwrite-native-backend --quiet --release --target x86_64-apple-darwin | |
| cargo build --quiet --manifest-path vendor/codex-acp/Cargo.toml --release --target aarch64-apple-darwin | |
| cargo build --quiet --manifest-path vendor/codex-acp/Cargo.toml --release --target x86_64-apple-darwin | |
| - name: Download embedded Node runtimes | |
| shell: bash | |
| run: | | |
| NODE_VERSION="$(node -p "process.version.replace(/^v/, '')")" | |
| DEST="$RUNNER_TEMP/node-dist" | |
| mkdir -p "$DEST" | |
| for NODE_DIST in darwin-arm64 darwin-x64; do | |
| DIST="node-v${NODE_VERSION}-${NODE_DIST}" | |
| curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/${DIST}.tar.gz" -o "$RUNNER_TEMP/${NODE_DIST}.tar.gz" | |
| tar -xzf "$RUNNER_TEMP/${NODE_DIST}.tar.gz" -C "$DEST" | |
| done | |
| echo "NEVERWRITE_EMBEDDED_NODE_BIN_ARM64=$DEST/node-v${NODE_VERSION}-darwin-arm64/bin/node" >> "$GITHUB_ENV" | |
| echo "NEVERWRITE_EMBEDDED_NODE_BIN_X64=$DEST/node-v${NODE_VERSION}-darwin-x64/bin/node" >> "$GITHUB_ENV" | |
| echo "NEVERWRITE_ELECTRON_OUTPUT_DIR=$RUNNER_TEMP/electron-dist" >> "$GITHUB_ENV" | |
| - name: Export sidecar environment | |
| shell: bash | |
| run: | | |
| echo "NEVERWRITE_NATIVE_BACKEND_BUNDLE_BIN_ARM64=$GITHUB_WORKSPACE/target/aarch64-apple-darwin/release/neverwrite-native-backend" >> "$GITHUB_ENV" | |
| echo "NEVERWRITE_NATIVE_BACKEND_BUNDLE_BIN_X64=$GITHUB_WORKSPACE/target/x86_64-apple-darwin/release/neverwrite-native-backend" >> "$GITHUB_ENV" | |
| echo "NEVERWRITE_CODEX_ACP_BUNDLE_BIN_ARM64=$GITHUB_WORKSPACE/vendor/codex-acp/target/aarch64-apple-darwin/release/codex-acp" >> "$GITHUB_ENV" | |
| echo "NEVERWRITE_CODEX_ACP_BUNDLE_BIN_X64=$GITHUB_WORKSPACE/vendor/codex-acp/target/x86_64-apple-darwin/release/codex-acp" >> "$GITHUB_ENV" | |
| - name: Package unsigned Electron app | |
| working-directory: apps/desktop | |
| run: npm run electron:package:unsigned -- --platform mac --arch universal | |
| - name: Smoke packaged app executable | |
| working-directory: apps/desktop | |
| env: | |
| NEVERWRITE_ELECTRON_DIST_ARCH: universal | |
| run: npm run electron:app:smoke:packaged | |
| - name: Smoke packaged sidecar | |
| working-directory: apps/desktop | |
| env: | |
| NEVERWRITE_ELECTRON_DIST_ARCH: universal | |
| run: npm run electron:sidecar:smoke:packaged | |
| - name: Verify universal runtime binaries | |
| shell: bash | |
| run: | | |
| APP_PATH="" | |
| for candidate in \ | |
| "$NEVERWRITE_ELECTRON_OUTPUT_DIR/mac-universal/NeverWrite.app" \ | |
| "$NEVERWRITE_ELECTRON_OUTPUT_DIR/mac/NeverWrite.app"; do | |
| if [[ -d "$candidate" ]]; then | |
| APP_PATH="$candidate" | |
| break | |
| fi | |
| done | |
| if [[ -z "$APP_PATH" ]]; then | |
| echo "Could not find packaged NeverWrite.app in $NEVERWRITE_ELECTRON_OUTPUT_DIR." >&2 | |
| exit 1 | |
| fi | |
| verify_universal() { | |
| local binary_path="$1" | |
| local archs | |
| archs="$(lipo -archs "$binary_path")" | |
| echo "$binary_path: $archs" | |
| if [[ "$archs" != *"arm64"* || "$archs" != *"x86_64"* ]]; then | |
| echo "Expected universal arm64/x86_64 binary: $binary_path" >&2 | |
| exit 1 | |
| fi | |
| } | |
| verify_universal "$APP_PATH/Contents/Resources/native-backend/neverwrite-native-backend" | |
| verify_universal "$APP_PATH/Contents/Resources/native-backend/binaries/codex-acp" | |
| verify_universal "$APP_PATH/Contents/Resources/native-backend/embedded/node/bin/node" | |
| windows-x64: | |
| name: Windows x64 | |
| runs-on: windows-latest | |
| timeout-minutes: 120 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: apps/desktop/package-lock.json | |
| - name: Setup Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-pc-windows-msvc | |
| - name: Cache Rust build outputs | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install desktop dependencies | |
| working-directory: apps/desktop | |
| run: npm ci | |
| - name: Build target-specific sidecars | |
| shell: bash | |
| run: | | |
| cargo build -p neverwrite-native-backend --quiet --release --target x86_64-pc-windows-msvc | |
| cargo build --quiet --manifest-path vendor/codex-acp/Cargo.toml --release --target x86_64-pc-windows-msvc | |
| - name: Download embedded Node runtime | |
| shell: bash | |
| run: | | |
| NODE_VERSION="$(node -p "process.version.replace(/^v/, '')")" | |
| DIST="node-v${NODE_VERSION}-win-x64" | |
| DEST="$RUNNER_TEMP/node-dist" | |
| mkdir -p "$DEST" | |
| curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/${DIST}.zip" -o "$RUNNER_TEMP/node.zip" | |
| powershell -NoProfile -Command "Expand-Archive -Path (Join-Path \$env:RUNNER_TEMP 'node.zip') -DestinationPath (Join-Path \$env:RUNNER_TEMP 'node-dist') -Force" | |
| echo "NEVERWRITE_EMBEDDED_NODE_BIN=$DEST/${DIST}/node.exe" >> "$GITHUB_ENV" | |
| echo "NEVERWRITE_ELECTRON_OUTPUT_DIR=$RUNNER_TEMP/electron-dist" >> "$GITHUB_ENV" | |
| - name: Export sidecar environment | |
| shell: bash | |
| run: | | |
| NATIVE_BACKEND_BIN="$GITHUB_WORKSPACE/target/x86_64-pc-windows-msvc/release/neverwrite-native-backend.exe" | |
| CODEX_BIN="$GITHUB_WORKSPACE/vendor/codex-acp/target/x86_64-pc-windows-msvc/release/codex-acp.exe" | |
| echo "NEVERWRITE_NATIVE_BACKEND_BUNDLE_BIN=$NATIVE_BACKEND_BIN" >> "$GITHUB_ENV" | |
| echo "NEVERWRITE_CODEX_ACP_BUNDLE_BIN=$CODEX_BIN" >> "$GITHUB_ENV" | |
| - name: Package unsigned Electron app | |
| working-directory: apps/desktop | |
| env: | |
| CSC_IDENTITY_AUTO_DISCOVERY: "false" | |
| run: npm run electron:package:unsigned -- --platform win --arch x64 | |
| - name: Smoke packaged sidecar | |
| working-directory: apps/desktop | |
| env: | |
| NEVERWRITE_ELECTRON_DIST_ARCH: x64 | |
| run: npm run electron:sidecar:smoke:packaged | |
| linux: | |
| name: ${{ matrix.name }} | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 120 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Linux x64 | |
| arch: x64 | |
| target: x86_64-unknown-linux-gnu | |
| - name: Linux ARM64 | |
| arch: arm64 | |
| target: aarch64-unknown-linux-gnu | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: apps/desktop/package-lock.json | |
| - name: Setup Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Cache Rust build outputs | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install Linux build dependencies | |
| shell: bash | |
| run: | | |
| if [[ "${{ matrix.target }}" == "aarch64-unknown-linux-gnu" ]]; then | |
| # GitHub's amd64 Ubuntu runners may use mirrorlist or | |
| # deb822 sources. Replace only Ubuntu's default sources so | |
| # apt never requests arm64 indexes from non-ports mirrors. | |
| while IFS= read -r source_file; do | |
| if sudo grep -Eq 'ubuntu\.com|apt-mirrors' "$source_file"; then | |
| sudo mv "$source_file" "${source_file}.disabled" | |
| fi | |
| done < <(sudo find /etc/apt -maxdepth 2 -type f \( -name '*.list' -o -name '*.sources' \)) | |
| sudo dpkg --add-architecture arm64 | |
| sudo tee /etc/apt/sources.list.d/ubuntu-amd64.list >/dev/null <<'EOF' | |
| deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy main restricted universe multiverse | |
| deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse | |
| deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse | |
| deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-security main restricted universe multiverse | |
| EOF | |
| sudo tee /etc/apt/sources.list.d/ubuntu-ports-arm64.list >/dev/null <<'EOF' | |
| deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse | |
| deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse | |
| deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse | |
| deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted universe multiverse | |
| EOF | |
| fi | |
| sudo apt-get update | |
| sudo apt-get install -y pkg-config libcap-dev | |
| if [[ "${{ matrix.target }}" == "aarch64-unknown-linux-gnu" ]]; then | |
| sudo apt-get install -y gcc-aarch64-linux-gnu libcap-dev:arm64 libssl-dev:arm64 | |
| echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV" | |
| echo "PKG_CONFIG_ALLOW_CROSS=1" >> "$GITHUB_ENV" | |
| echo "PKG_CONFIG_LIBDIR=/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/share/pkgconfig" >> "$GITHUB_ENV" | |
| fi | |
| - name: Install desktop dependencies | |
| working-directory: apps/desktop | |
| run: npm ci | |
| - name: Package unsigned Electron app | |
| working-directory: apps/desktop | |
| env: | |
| CSC_IDENTITY_AUTO_DISCOVERY: "false" | |
| NEVERWRITE_ELECTRON_OUTPUT_DIR: ${{ runner.temp }}/electron-dist | |
| run: npm run electron:release:local -- --platform linux --arch ${{ matrix.arch }} --unsigned | |
| - name: Smoke packaged sidecar | |
| if: matrix.arch == 'x64' | |
| working-directory: apps/desktop | |
| env: | |
| NEVERWRITE_ELECTRON_OUTPUT_DIR: ${{ runner.temp }}/electron-dist | |
| NEVERWRITE_ELECTRON_DIST_ARCH: ${{ matrix.arch }} | |
| run: npm run electron:sidecar:smoke:packaged | |
| - name: Smoke packaged app executable | |
| if: matrix.arch == 'x64' | |
| working-directory: apps/desktop | |
| env: | |
| NEVERWRITE_ELECTRON_OUTPUT_DIR: ${{ runner.temp }}/electron-dist | |
| NEVERWRITE_ELECTRON_DIST_ARCH: ${{ matrix.arch }} | |
| run: npm run electron:app:smoke:packaged | |
| - name: Stage release assets and feed metadata | |
| shell: bash | |
| run: | | |
| VERSION="$(node -p "require('./apps/desktop/package.json').version")" | |
| mkdir -p "$RUNNER_TEMP/release-assets" "$RUNNER_TEMP/target-metadata" | |
| node apps/desktop/scripts/stage-electron-release-assets.mjs \ | |
| --dist-dir "$RUNNER_TEMP/electron-dist" \ | |
| --target ${{ matrix.target }} \ | |
| --version "$VERSION" \ | |
| --tag "v$VERSION" \ | |
| --repo "${{ github.repository }}" \ | |
| --output-dir "$RUNNER_TEMP/release-assets" \ | |
| --metadata-out "$RUNNER_TEMP/target-metadata/${{ matrix.target }}.json" |