Skip to content
Open
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
52 changes: 52 additions & 0 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Builds and tests both macOS architectures on every change to the code, so a
# release never finds out about an Intel or Apple silicon break. The zip is
# kept as an artifact for trying a change before it is released.
#
# Separate from ci.yml so the macOS and Linux CI can evolve independently.
name: CI macOS

on:
push:
branches: [main]
paths: ["src/**", "assets/**", "extensions/**", "Cargo.*", "rust-toolchain.toml", "script/bundle.sh", "script/notarize.sh", "script/third-party-licenses.sh", "resources/**", ".github/workflows/ci-macos.yml"]
pull_request:
paths: ["src/**", "assets/**", "extensions/**", "Cargo.*", "rust-toolchain.toml", "script/bundle.sh", "script/notarize.sh", "script/third-party-licenses.sh", "resources/**", ".github/workflows/ci-macos.yml"]
workflow_dispatch:

permissions:
contents: read

jobs:
macos:
strategy:
fail-fast: false
matrix:
# macos-15 is Apple silicon; macos-15-intel is the Intel image.
runner: [macos-15, macos-15-intel]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4

- uses: Swatinem/rust-cache@v2

- name: Test
run: cargo test --locked

- name: Install cargo-about
run: cargo install cargo-about --locked --features cli --version 0.9.3

- name: Build the app bundle
run: script/bundle.sh

- name: Package
run: |
version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
arch=$(uname -m | sed 's/arm64/aarch64/')
asset="target/release/Pi-GPUI-$version-$arch.zip"
ditto -c -k --sequesterRsrc --keepParent "target/release/Pi GPUI.app" "$asset"

- uses: actions/upload-artifact@v4
with:
name: pi-gpui-macos-${{ runner.arch }}
path: target/release/Pi-GPUI-*-*.zip
retention-days: 14
78 changes: 78 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,84 @@ jobs:
if: always()
run: security delete-keychain "$RUNNER_TEMP/signing.keychain-db" || true

# Added by the Intel Mac port: builds the same app for x86_64 and adds its
# zip to the release the arm64 job created. The steps are the arm64 job's,
# so it stays an independent, additive change until both architectures are
# folded into one matrix.
macos-intel:
needs: macos
runs-on: macos-15-intel
steps:
- uses: actions/checkout@v4

- name: Check that the tag matches Cargo.toml
run: |
version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
if [ "v$version" != "$GITHUB_REF_NAME" ]; then
echo "Tag $GITHUB_REF_NAME does not match Cargo.toml version $version" >&2
exit 1
fi
echo "VERSION=$version" >> "$GITHUB_ENV"

- uses: Swatinem/rust-cache@v2

- name: Test
run: cargo test --locked

- name: Install cargo-about
run: cargo install cargo-about --locked --features cli --version 0.9.3

- name: Import the signing certificate
env:
CERTIFICATE_P12: ${{ secrets.MACOS_CERTIFICATE_P12 }}
CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
run: |
keychain="$RUNNER_TEMP/signing.keychain-db"
keychain_password=$(uuidgen)
echo "$CERTIFICATE_P12" | base64 --decode > "$RUNNER_TEMP/certificate.p12"
security create-keychain -p "$keychain_password" "$keychain"
security set-keychain-settings -lut 21600 "$keychain"
security unlock-keychain -p "$keychain_password" "$keychain"
security import "$RUNNER_TEMP/certificate.p12" -k "$keychain" \
-P "$CERTIFICATE_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: \
-s -k "$keychain_password" "$keychain" > /dev/null
security list-keychains -d user -s "$keychain" $(security list-keychains -d user | tr -d '"')
rm "$RUNNER_TEMP/certificate.p12"
identity=$(security find-identity -v -p codesigning "$keychain" \
| sed -n 's/.*"\(Developer ID Application: .*\)"/\1/p' | head -1)
if [ -z "$identity" ]; then
echo "No Developer ID Application certificate in MACOS_CERTIFICATE_P12" >&2
exit 1
fi
echo "SIGN_IDENTITY=$identity" >> "$GITHUB_ENV"

- name: Build the app bundle
run: script/bundle.sh

- name: Notarize
env:
API_KEY_P8: ${{ secrets.APPLE_API_KEY_P8 }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER_ID: ${{ secrets.APPLE_API_ISSUER_ID }}
run: |
export APPLE_API_KEY_PATH="$RUNNER_TEMP/AuthKey.p8"
printf '%s\n' "$API_KEY_P8" > "$APPLE_API_KEY_PATH"
script/notarize.sh "target/release/Pi GPUI.app"
rm "$APPLE_API_KEY_PATH"

- name: Package and add it to the release
env:
GH_TOKEN: ${{ github.token }}
run: |
asset="Pi-GPUI-$VERSION-x86_64.zip"
ditto -c -k --sequesterRsrc --keepParent "target/release/Pi GPUI.app" "target/release/$asset"
gh release upload "$GITHUB_REF_NAME" "target/release/$asset" --clobber

- name: Remove the signing keychain
if: always()
run: security delete-keychain "$RUNNER_TEMP/signing.keychain-db" || true

# The Linux builds join the release the macOS job created. If one of them
# fails, the macOS release is already out and the job can be run again.
linux:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A native GUI for the [pi](https://github.com/earendil-works/pi) coding agent, wr

The app is 16 MB, its window is up in about 0.4 s, and it uses about 75 MB of memory at idle. Electron clients for pi take 0.5 to 1.1 s and 190 to 430 MB. Measured on an M1 Pro with no projects open, counting each app's own processes ([method and script](docs/BENCHMARKS.md)).

[![macOS 13+, Apple silicon](https://img.shields.io/badge/macOS-13%2B%20Apple%20silicon-111?logo=apple&logoColor=white)](#install)
[![macOS 13+, Apple silicon and Intel](https://img.shields.io/badge/macOS-13%2B%20Apple%20silicon%20%C2%B7%20Intel-111?logo=apple&logoColor=white)](#install)
[![Linux x86_64 and arm64](https://img.shields.io/badge/Linux-x86__64%20%C2%B7%20arm64%20(beta)-111?logo=linux&logoColor=white)](#install)
[![MIT](https://img.shields.io/badge/license-MIT-111)](LICENSE)

Expand All @@ -16,13 +16,13 @@ The app is 16 MB, its window is up in about 0.4 s, and it uses about 75 MB of me

## Install

**macOS** (Apple silicon, macOS 13 or newer)
**macOS** (Apple silicon and Intel, macOS 13 or newer)

```sh
brew install --cask bytesbay/tap/pi-gpui
```

Or download `Pi-GPUI-*.zip` from [Releases](https://github.com/bytesbay/pi-gpui/releases) and move the app to Applications. Releases are signed with a Developer ID certificate and notarized by Apple.
Or download `Pi-GPUI-*-aarch64.zip` (Apple silicon) or `Pi-GPUI-*-x86_64.zip` (Intel) from [Releases](https://github.com/bytesbay/pi-gpui/releases) and move the app to Applications. Releases are signed with a Developer ID certificate and notarized by Apple.

**Linux** (x86_64 and arm64, beta)

Expand Down