Skip to content

Commit 3c585b3

Browse files
committed
ci(macos): require self-contained release artifacts
Signed-off-by: xunzhuo <xunzhuo@vllm-semantic-router.ai>
1 parent 573bf0e commit 3c585b3

2 files changed

Lines changed: 38 additions & 5 deletions

File tree

.github/workflows/macos-latest-release.yml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,20 @@ concurrency:
2525
jobs:
2626
build-macos:
2727
name: Build macOS ${{ matrix.target }}
28-
runs-on: macos-latest
28+
runs-on: ${{ matrix.runner }}
2929
outputs:
3030
signing_mode: ${{ steps.prepare-signing.outputs.signing_mode }}
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
target:
35-
- aarch64-apple-darwin
36-
- x86_64-apple-darwin
34+
include:
35+
- target: aarch64-apple-darwin
36+
runner: macos-15
37+
- target: x86_64-apple-darwin
38+
runner: macos-15-intel
3739
env:
3840
ALLOW_UNSIGNED: ${{ github.event_name == 'workflow_dispatch' && inputs.allow_unsigned || 'true' }}
41+
MACOS_BUNDLE_RUNTIME: "1"
3942
steps:
4043
- name: Checkout
4144
uses: actions/checkout@v4
@@ -47,6 +50,22 @@ jobs:
4750
with:
4851
python-version: "3.12"
4952

53+
- name: Setup uv
54+
uses: astral-sh/setup-uv@v5
55+
with:
56+
enable-cache: true
57+
cache-dependency-glob: |
58+
pyproject.toml
59+
uv.lock
60+
61+
- name: Cache macOS runtime payloads
62+
uses: actions/cache@v4
63+
with:
64+
path: ~/Library/Caches/ElephantAgent/macos-runtime/${{ matrix.target }}
65+
key: macos-runtime-${{ matrix.target }}-${{ hashFiles('pyproject.toml', 'uv.lock', 'apps/macos/Scripts/build-app.sh', 'apps/macos/Scripts/package-runtime.sh') }}
66+
restore-keys: |
67+
macos-runtime-${{ matrix.target }}-
68+
5069
- name: Prepare Apple signing
5170
id: prepare-signing
5271
shell: bash
@@ -129,7 +148,19 @@ jobs:
129148
env:
130149
MACOS_APP_BUILD_NUMBER: ${{ github.run_number }}
131150
run: |
132-
make macos-build MACOS_TARGET="${{ matrix.target }}"
151+
make macos-build MACOS_TARGET="${{ matrix.target }}" MACOS_BUNDLE_RUNTIME="${MACOS_BUNDLE_RUNTIME}"
152+
153+
- name: Verify self-contained runtime
154+
shell: bash
155+
run: |
156+
set -euo pipefail
157+
app="apps/macos/.build/release/${{ matrix.target }}/Elephant Agent.app"
158+
runtime="${app}/Contents/Resources/Runtime"
159+
test -x "${runtime}/python/bin/python3.12"
160+
test -d "${runtime}/site-packages"
161+
test -d "${runtime}/ms-playwright"
162+
test -f "${runtime}/manifest.json"
163+
du -sh "${app}" "${runtime}"
133164
134165
- name: Upload macOS artifact
135166
uses: actions/upload-artifact@v4

apps/macos/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ make macos-build-all \
4848
Without `MACOS_SIGNING_IDENTITY`, builds remain ad-hoc signed and notarization is skipped so local developers can still build a DMG. Ad-hoc artifacts are useful for testing but are not Gatekeeper-clean for broad distribution. Official shareable releases should use Developer ID signing and notarization.
4949

5050
`make macos-release-latest` expects `gh` authentication and replaces the GitHub `latest` release/tag with the current local artifacts. The CI workflow `.github/workflows/macos-latest-release.yml` runs the same build on each push to `main`, uploads both macOS architecture artifacts, writes `latest.json`, and replaces the `latest` GitHub release.
51+
52+
The `latest` CI release forces `MACOS_BUNDLE_RUNTIME=1`, installs `uv`, builds each architecture on a matching macOS runner, and checks `Contents/Resources/Runtime` before upload. If the self-contained runtime is missing, CI fails instead of publishing a bootstrap-sized DMG. The bootstrap fallback remains available for local or emergency builds with `MACOS_BUNDLE_RUNTIME=0`.

0 commit comments

Comments
 (0)