@@ -327,14 +327,16 @@ write_receipt() {
327327
328328package_host () {
329329 [[ " $( uname -s) " == ' Darwin' ]] || fail ' elevation packaging requires macOS'
330- local source_commit prefix zip_path receipt_path checksum_path notary_result
330+ local source_commit prefix zip_path receipt_path checksum_path installer_path installer_checksum_path notary_result
331331 source_commit=" $( git -C " $ROOT_DIR " rev-parse HEAD) "
332332 [[ " $source_commit " =~ ^[0-9a-f]{40}$ ]] || fail ' could not resolve exact source commit'
333333 prefix=" OpenClaw-${source_commit} -stable"
334334 zip_path=" $OUTPUT_DIR /${prefix} .zip"
335335 receipt_path=" $OUTPUT_DIR /${prefix} .json"
336336 checksum_path=" $zip_path .sha256"
337- for output in " $zip_path " " $receipt_path " " $checksum_path " ; do
337+ installer_path=" $OUTPUT_DIR /${prefix} -installer.sh"
338+ installer_checksum_path=" $installer_path .sha256"
339+ for output in " $zip_path " " $receipt_path " " $checksum_path " " $installer_path " " $installer_checksum_path " ; do
338340 [[ ! -e " $output " ]] || fail " immutable elevation output already exists: $output "
339341 done
340342 mkdir -p " $OUTPUT_DIR "
@@ -364,18 +366,31 @@ package_host() {
364366 extract_archive " $tmp_zip " extracted
365367 [[ " $( plist_value " $extracted " OpenClawGitCommit) " == " $source_commit " ]] ||
366368 fail ' extracted elevation source mismatch'
367- local archive_sha notary_id main_archs helper_archs main_entitlements helper_entitlements
369+ local archive_sha installer_sha committed_installer_sha notary_id
370+ local main_archs helper_archs main_entitlements helper_entitlements
368371 archive_sha=" $( shasum -a 256 " $tmp_zip " | awk ' {print $1}' ) "
372+ local tmp_installer=" ${installer_path} .tmp.$$ "
373+ cp " $ROOT_DIR /scripts/mac-elevation-host.sh" " $tmp_installer "
374+ chmod 555 " $tmp_installer "
375+ installer_sha=" $( shasum -a 256 " $tmp_installer " | awk ' {print $1}' ) "
376+ committed_installer_sha=" $( git -C " $ROOT_DIR " show " ${source_commit} :scripts/mac-elevation-host.sh" | shasum -a 256 | awk ' {print $1}' ) "
377+ [[ " $installer_sha " == " $committed_installer_sha " ]] ||
378+ fail ' portable installer does not match the selected source commit'
369379 notary_id=" $( jq -r ' .id // empty' " $notary_result " ) "
370380 [[ -n " $notary_id " ]] || fail ' accepted notarization id was not recorded'
371381 main_archs=" $( lipo -archs " $extracted /Contents/MacOS/OpenClaw" ) "
372382 helper_archs=" $( lipo -archs " $extracted /Contents/MacOS/openclaw-mlx-tts" ) "
373383 main_entitlements=" $( entitlements_for " $extracted /Contents/MacOS/OpenClaw" | shasum -a 256 | awk ' {print $1}' ) "
374384 helper_entitlements=" $( entitlements_for " $extracted /Contents/MacOS/openclaw-mlx-tts" | shasum -a 256 | awk ' {print $1}' ) "
375385 mv " $tmp_zip " " $zip_path "
386+ mv " $tmp_installer " " $installer_path "
376387 jq -n \
377388 --arg archive " $( basename " $zip_path " ) " \
378389 --arg archiveSha256 " $archive_sha " \
390+ --arg archiveChecksum " $( basename " $checksum_path " ) " \
391+ --arg installer " $( basename " $installer_path " ) " \
392+ --arg installerSha256 " $installer_sha " \
393+ --arg installerChecksum " $( basename " $installer_checksum_path " ) " \
379394 --arg sourceCommit " $source_commit " \
380395 --arg peekabooCommit " $( plist_value " $extracted " PeekabooSourceCommit) " \
381396 --arg version " $version " \
@@ -388,13 +403,17 @@ package_host() {
388403 --arg mainEntitlementsSha256 " $main_entitlements " \
389404 --arg helperEntitlementsSha256 " $helper_entitlements " \
390405 --arg notarizationId " $notary_id " \
391- ' {archive:$archive,archiveSha256:$archiveSha256,sourceCommit:$sourceCommit,peekabooCommit:$peekabooCommit,version:$version,build:$build,authority:$authority,teamIdentifier:$teamIdentifier,cdhash:$cdhash,architectures:{main:$mainArchitectures,helper:$helperArchitectures},entitlementsSha256:{main:$mainEntitlementsSha256,helper:$helperEntitlementsSha256},notarizationId:$notarizationId}' > " ${receipt_path} .tmp.$$ "
406+ ' {archive:$archive,archiveSha256:$archiveSha256,archiveChecksum:$archiveChecksum,installer:$installer,installerSha256:$installerSha256,installerChecksum:$installerChecksum, sourceCommit:$sourceCommit,peekabooCommit:$peekabooCommit,version:$version,build:$build,authority:$authority,teamIdentifier:$teamIdentifier,cdhash:$cdhash,architectures:{main:$mainArchitectures,helper:$helperArchitectures},entitlementsSha256:{main:$mainEntitlementsSha256,helper:$helperEntitlementsSha256},notarizationId:$notarizationId}' > " ${receipt_path} .tmp.$$ "
392407 chmod 444 " ${receipt_path} .tmp.$$ "
393408 mv " ${receipt_path} .tmp.$$ " " $receipt_path "
394409 printf ' %s %s\n' " $archive_sha " " $( basename " $zip_path " ) " > " ${checksum_path} .tmp.$$ "
395410 chmod 444 " ${checksum_path} .tmp.$$ "
396411 mv " ${checksum_path} .tmp.$$ " " $checksum_path "
397- printf ' Elevation archive: %s\nReceipt: %s\nSHA-256: %s\n' " $zip_path " " $receipt_path " " $archive_sha "
412+ printf ' %s %s\n' " $installer_sha " " $( basename " $installer_path " ) " > " ${installer_checksum_path} .tmp.$$ "
413+ chmod 444 " ${installer_checksum_path} .tmp.$$ "
414+ mv " ${installer_checksum_path} .tmp.$$ " " $installer_checksum_path "
415+ printf ' Elevation archive: %s\nInstaller: %s\nReceipt: %s\nArchive SHA-256: %s\nInstaller SHA-256: %s\n' \
416+ " $zip_path " " $installer_path " " $receipt_path " " $archive_sha " " $installer_sha "
398417}
399418
400419install_host () {
0 commit comments