Skip to content

Commit bc95436

Browse files
authored
release: upload macos preflight artifacts (#53105)
* release: upload macos preflight artifacts * release: speed up macos preflight * release: use xlarge macos runner * release: skip dmg path in macos preflight
1 parent f698774 commit bc95436

File tree

3 files changed

+53
-24
lines changed

3 files changed

+53
-24
lines changed

.agents/skills/openclaw-release-maintainer/SKILL.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ OPENCLAW_INSTALL_SMOKE_SKIP_NONROOT=1 pnpm test:install:smoke
111111
the npm version is already published.
112112
- Validation-only runs may be dispatched from a branch when you are testing a
113113
workflow change before merge.
114+
- macOS release workflows run on GitHub's xlarge macOS runner and use a
115+
SwiftPM cache because the Swift build/test/package path is CPU-heavy.
116+
- macOS preflight uploads the ad-hoc `.zip` output as a workflow artifact so
117+
maintainers can download and inspect the built package before any real
118+
publish run.
114119
- npm preflight and macOS preflight must both pass before any publish run
115120
starts.
116121
- Real publish runs must be dispatched from `main`; branch-dispatched publish

.github/workflows/macos-release.yml

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ env:
2525

2626
jobs:
2727
preflight_macos_release:
28-
runs-on: macos-latest
28+
# Use GitHub's xlarge macOS runner because release packaging is
29+
# Swift-heavy and benefits from the faster hosted hardware tier.
30+
runs-on: macos-latest-xlarge
2931
permissions:
3032
contents: read
3133
steps:
@@ -59,6 +61,14 @@ jobs:
5961
xcodebuild -version
6062
swift --version
6163
64+
- name: Cache SwiftPM
65+
uses: actions/cache@v5
66+
with:
67+
path: ~/Library/Caches/org.swift.swiftpm
68+
key: ${{ runner.os }}-swiftpm-release-${{ hashFiles('apps/macos/Package.resolved') }}
69+
restore-keys: |
70+
${{ runner.os }}-swiftpm-release-
71+
6272
- name: Ensure matching GitHub release exists
6373
env:
6474
GH_TOKEN: ${{ github.token }}
@@ -94,18 +104,6 @@ jobs:
94104
NODE_OPTIONS: --max-old-space-size=4096
95105
run: pnpm release:check
96106

97-
- name: Swift build
98-
run: |
99-
set -euo pipefail
100-
for attempt in 1 2 3; do
101-
if swift build --package-path apps/macos --configuration release; then
102-
exit 0
103-
fi
104-
echo "swift build failed (attempt $attempt/3). Retrying…"
105-
sleep $((attempt * 20))
106-
done
107-
exit 1
108-
109107
- name: Swift test
110108
run: |
111109
set -euo pipefail
@@ -119,18 +117,31 @@ jobs:
119117
exit 1
120118
121119
- name: Package macOS release with ad-hoc signing
120+
id: package_preflight
122121
env:
123-
APP_VERSION: ${{ steps.package_version.outputs.value }}
124122
BUNDLE_ID: ai.openclaw.mac
125123
BUILD_CONFIG: release
126124
CODESIGN_TIMESTAMP: "off"
127125
SIGN_IDENTITY: "-"
128-
SKIP_NOTARIZE: "1"
129126
SKIP_PNPM_INSTALL: "1"
130127
SKIP_TSC: "1"
131128
SKIP_UI_BUILD: "1"
132129
SPARKLE_FEED_URL: ${{ env.SPARKLE_FEED_URL }}
133-
run: scripts/package-mac-dist.sh
130+
run: |
131+
set -euo pipefail
132+
scripts/package-mac-app.sh
133+
VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" dist/OpenClaw.app/Contents/Info.plist)
134+
ZIP_PATH="dist/OpenClaw-${VERSION}.zip"
135+
rm -f "$ZIP_PATH"
136+
ditto -c -k --sequesterRsrc --keepParent dist/OpenClaw.app "$ZIP_PATH"
137+
echo "zip_path=$ZIP_PATH" >> "$GITHUB_OUTPUT"
138+
139+
- name: Upload preflight macOS artifacts
140+
uses: actions/upload-artifact@v7
141+
with:
142+
name: macos-preflight-${{ inputs.tag }}
143+
path: ${{ steps.package_preflight.outputs.zip_path }}
144+
if-no-files-found: error
134145

135146
validate_publish_dispatch_ref:
136147
if: ${{ !inputs.preflight_only }}
@@ -151,7 +162,7 @@ jobs:
151162
publish_macos_release:
152163
needs: [preflight_macos_release, validate_publish_dispatch_ref]
153164
if: ${{ !inputs.preflight_only }}
154-
runs-on: macos-latest
165+
runs-on: macos-latest-xlarge
155166
environment: mac-release
156167
concurrency:
157168
# Stable releases all derive the same shared appcast.xml; serialize those
@@ -191,6 +202,14 @@ jobs:
191202
xcodebuild -version
192203
swift --version
193204
205+
- name: Cache SwiftPM
206+
uses: actions/cache@v5
207+
with:
208+
path: ~/Library/Caches/org.swift.swiftpm
209+
key: ${{ runner.os }}-swiftpm-release-${{ hashFiles('apps/macos/Package.resolved') }}
210+
restore-keys: |
211+
${{ runner.os }}-swiftpm-release-
212+
194213
- name: Ensure matching GitHub release exists
195214
env:
196215
GH_TOKEN: ${{ github.token }}

scripts/package-mac-dist.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ DSYM_ZIP="$ROOT_DIR/dist/OpenClaw-$VERSION.dSYM.zip"
3636
SKIP_NOTARIZE="${SKIP_NOTARIZE:-0}"
3737
NOTARIZE=1
3838
SKIP_DSYM="${SKIP_DSYM:-0}"
39+
SKIP_DMG="${SKIP_DMG:-0}"
3940

4041
if [[ "$SKIP_NOTARIZE" == "1" ]]; then
4142
NOTARIZE=0
@@ -53,15 +54,19 @@ echo "📦 Zip: $ZIP"
5354
rm -f "$ZIP"
5455
ditto -c -k --sequesterRsrc --keepParent "$APP" "$ZIP"
5556

56-
echo "💿 DMG: $DMG"
57-
"$ROOT_DIR/scripts/create-dmg.sh" "$APP" "$DMG"
57+
if [[ "$SKIP_DMG" != "1" ]]; then
58+
echo "💿 DMG: $DMG"
59+
"$ROOT_DIR/scripts/create-dmg.sh" "$APP" "$DMG"
5860

59-
if [[ "$NOTARIZE" == "1" ]]; then
60-
if [[ -n "${SIGN_IDENTITY:-}" ]]; then
61-
echo "🔏 Signing DMG: $DMG"
62-
/usr/bin/codesign --force --sign "$SIGN_IDENTITY" --timestamp "$DMG"
61+
if [[ "$NOTARIZE" == "1" ]]; then
62+
if [[ -n "${SIGN_IDENTITY:-}" ]]; then
63+
echo "🔏 Signing DMG: $DMG"
64+
/usr/bin/codesign --force --sign "$SIGN_IDENTITY" --timestamp "$DMG"
65+
fi
66+
"$ROOT_DIR/scripts/notarize-mac-artifact.sh" "$DMG"
6367
fi
64-
"$ROOT_DIR/scripts/notarize-mac-artifact.sh" "$DMG"
68+
else
69+
echo "💿 Skipping DMG (SKIP_DMG=1)"
6570
fi
6671

6772
if [[ "$SKIP_DSYM" != "1" ]]; then

0 commit comments

Comments
 (0)