Skip to content

Free, open-source macOS cleaner. CleanMyMac alternative with zero telemetry. Native SwiftUI, scheduled auto-cleaning, Xcode/Homebrew/system cache cleanup. MIT licensed.

ci: signed/notarized release pipeline + bump 2.2.0

moamen2ced927317c3
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..f605635
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,311 @@
+name: Release
+
+on:
+ push:
+ tags:
+ - 'v*.*.*'
+ workflow_dispatch:
+ inputs:
+ version:
+ description: 'Version to release (e.g. 2.2.0). Must match project.yml MARKETING_VERSION.'
+ required: true
+ type: string
+ dry_run:
+ description: 'Build + sign + notarize but skip release upload + homebrew bump.'
+ required: false
+ default: false
+ type: boolean
+
+permissions:
+ contents: write
+
+env:
+ APP_NAME: PureMac
+ BUNDLE_ID: com.puremac.app
+ TEAM_ID: H3WXHVTP97
+ SCHEME: PureMac
+ PROJECT: PureMac.xcodeproj
+ CONFIGURATION: Release
+
+jobs:
+ release:
+ name: Build, sign, notarize, release
+ runs-on: macos-15
+ timeout-minutes: 60
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Resolve version
+ id: ver
+ run: |
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+ VERSION="${{ inputs.version }}"
+ else
+ VERSION="${GITHUB_REF_NAME#v}"
+ fi
+ echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
+ echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT"
+ echo "Releasing version: ${VERSION}"
+
+ - name: Verify version matches project.yml
+ run: |
+ PROJ_VERSION=$(grep -E '^\s*MARKETING_VERSION:' project.yml | sed -E 's/.*"([^"]+)".*/\1/')
+ if [[ "${PROJ_VERSION}" != "${{ steps.ver.outputs.version }}" ]]; then
+ echo "::error::project.yml MARKETING_VERSION (${PROJ_VERSION}) != release version (${{ steps.ver.outputs.version }}). Bump project.yml first."
+ exit 1
+ fi
+
+ - name: Select Xcode
+ run: sudo xcode-select -s /Applications/Xcode_16.4.app
+
+ - name: Install xcodegen + create-dmg
+ run: |
+ brew install xcodegen create-dmg
+
+ - name: Generate Xcode project
+ run: xcodegen generate
+
+ - name: Import Developer ID signing certificate
+ env:
+ BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
+ P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
+ KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
+ run: |
+ set -euo pipefail
+ CERT_PATH="${RUNNER_TEMP}/certificate.p12"
+ KEYCHAIN_PATH="${RUNNER_TEMP}/app-signing.keychain-db"
+ echo -n "${BUILD_CERTIFICATE_BASE64}" | base64 --decode -o "${CERT_PATH}"
+ security create-keychain -p "${KEYCHAIN_PASSWORD}" "${KEYCHAIN_PATH}"
+ security set-keychain-settings -lut 21600 "${KEYCHAIN_PATH}"
+ security unlock-keychain -p "${KEYCHAIN_PASSWORD}" "${KEYCHAIN_PATH}"
+ security import "${CERT_PATH}" -P "${P12_PASSWORD}" -A -t cert -f pkcs12 -k "${KEYCHAIN_PATH}"
+ security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "${KEYCHAIN_PASSWORD}" "${KEYCHAIN_PATH}" >/dev/null
+ security list-keychain -d user -s "${KEYCHAIN_PATH}" $(security list-keychain -d user | xargs)
+ # Verify identity loaded
+ security find-identity -v -p codesigning "${KEYCHAIN_PATH}" | grep "Developer ID Application: Moamen Basel"
+
+ - name: Archive (universal arm64 + x86_64)
+ run: |
+ set -euo pipefail
+ xcodebuild \
+ -project "${PROJECT}" \
+ -scheme "${SCHEME}" \
+ -configuration "${CONFIGURATION}" \
+ -destination 'generic/platform=macOS' \
+ -archivePath build/PureMac.xcarchive \
+ ARCHS="arm64 x86_64" \
+ ONLY_ACTIVE_ARCH=NO \
+ CODE_SIGN_STYLE=Manual \
+ CODE_SIGN_IDENTITY="Developer ID Application: Moamen Basel (H3WXHVTP97)" \
+ DEVELOPMENT_TEAM="${TEAM_ID}" \
+ OTHER_CODE_SIGN_FLAGS="--timestamp --options=runtime" \
+ archive | xcbeautify
+
+ - name: Export signed app
+ run: |
+ set -euo pipefail
+ cat > build/ExportOptions.plist <<'PLIST'
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+ <plist version="1.0">
+ <dict>
+ <key>method</key><string>developer-id</string>
+ <key>teamID</key><string>H3WXHVTP97</string>
+ <key>signingStyle</key><string>manual</string>
+ <key>signingCertificate</key><string>Developer ID Application</string>
+ </dict>
+ </plist>
+ PLIST
+ xcodebuild -exportArchive \
+ -archivePath build/PureMac.xcarchive \
+ -exportPath build/export \
+ -exportOptionsPlist build/ExportOptions.plist | xcbeautify
+
+ - name: Verify codesign + hardened runtime
+ run: |
+ set -euo pipefail
+ APP="build/export/PureMac.app"
+ codesign --verify --deep --strict --verbose=2 "${APP}"
+ codesign -dvv "${APP}" 2>&1 | tee /tmp/cs-info.txt
+ grep -q "flags=0x10000(runtime)" /tmp/cs-info.txt || { echo "::error::Hardened runtime missing"; exit 1; }
+ spctl --assess --type execute --verbose=4 "${APP}" || true
+ # Universal arch check
+ lipo -archs "${APP}/Contents/MacOS/PureMac" | grep -q "x86_64" && lipo -archs "${APP}/Contents/MacOS/PureMac" | grep -q "arm64"
+
+ - name: Build DMG
+ env:
+ VERSION: ${{ steps.ver.outputs.version }}
+ run: |
+ set -euo pipefail
+ DMG="build/PureMac-${VERSION}.dmg"
+ create-dmg \
+ --volname "PureMac ${VERSION}" \
+ --window-size 540 360 \
+ --icon-size 100 \
+ --icon "PureMac.app" 140 180 \
+ --hide-extension "PureMac.app" \
+ --app-drop-link 400 180 \
+ --no-internet-enable \
+ "${DMG}" \
+ build/export/PureMac.app
+ codesign --sign "Developer ID Application: Moamen Basel (H3WXHVTP97)" --timestamp "${DMG}"
+ codesign --verify --verbose=2 "${DMG}"
+
+ - name: Notarize DMG
+ env:
+ APPLE_ID: ${{ secrets.APPLE_ID }}
+ APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}
+ VERSION: ${{ steps.ver.outputs.version }}
+ run: |
+ set -euo pipefail
+ DMG="build/PureMac-${VERSION}.dmg"
+ xcrun notarytool submit "${DMG}" \
+ --apple-id "${APPLE_ID}" \
+ --password "${APPLE_APP_PASSWORD}" \
+ --team-id "${TEAM_ID}" \
+ --wait \
+ --timeout 30m
+ xcrun stapler staple "${DMG}"
+ xcrun stapler validate "${DMG}"
+ spctl --assess --type install --verbose=4 "${DMG}"
+
+ - name: Build notarized zip
+ env:
+ VERSION: ${{ steps.ver.outputs.version }}
+ run: |
+ set -euo pipefail
+ ZIP="build/PureMac-${VERSION}.zip"
+ # Notarize the .app inside a zip too (homebrew cask uses zip)
+ ditto -c -k --keepParent --sequesterRsrc build/export/PureMac.app build/PureMac-app.zip
+ xcrun notarytool submit build/PureMac-app.zip \
+ --apple-id "${{ secrets.APPLE_ID }}" \
+ --password "${{ secrets.APPLE_APP_PASSWORD }}" \
+ --team-id "${TEAM_ID}" \
+ --wait --timeout 30m
+ xcrun stapler staple build/export/PureMac.app
+ # Final shippable zip with stapled ticket
+ ditto -c -k --keepParent --sequesterRsrc build/export/PureMac.app "${ZIP}"
+
+ - name: Compute SHA256 checksums
+ id: sha
+ env:
+ VERSION: ${{ steps.ver.outputs.version }}
+ run: |
+ set -euo pipefail
+ DMG_SHA=$(shasum -a 256 "build/PureMac-${VERSION}.dmg" | awk '{print $1}')
+ ZIP_SHA=$(shasum -a 256 "build/PureMac-${VERSION}.zip" | awk '{print $1}')
+ echo "dmg=${DMG_SHA}" >> "$GITHUB_OUTPUT"
+ echo "zip=${ZIP_SHA}" >> "$GITHUB_OUTPUT"
+ {
+ echo "## Checksums"
+ echo ""
+ echo "| Asset | SHA-256 |"
+ echo "|-------|---------|"
+ echo "| PureMac-${VERSION}.dmg | \`${DMG_SHA}\` |"
+ echo "| PureMac-${VERSION}.zip | \`${ZIP_SHA}\` |"
+ } > build/CHECKSUMS.md
+
+ - name: Upload artifacts (always, for inspection)
+ uses: actions/upload-artifact@v4
+ with:
+ name: puremac-${{ steps.ver.outputs.version }}
+ path: |
+ build/PureMac-${{ steps.ver.outputs.version }}.dmg
+ build/PureMac-${{ steps.ver.outputs.version }}.zip
+ build/CHECKSUMS.md
+ retention-days: 14
+
+ - name: Create or update GitHub release
+ if: ${{ github.event_name == 'push' || inputs.dry_run == false }}
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ VERSION: ${{ steps.ver.outputs.version }}
+ TAG: ${{ steps.ver.outputs.tag }}
+ run: |
+ set -euo pipefail
+ NOTES_FILE=build/release-notes.md
+ {
+ echo "## PureMac ${VERSION}"
+ echo ""
+ echo "Universal binary (Intel + Apple Silicon). Signed with Developer ID + notarized + stapled by Apple."
+ echo ""
+ cat build/CHECKSUMS.md
+ echo ""
+ echo "### Install"
+ echo ""
+ echo "\`\`\`"
+ echo "brew tap momenbasel/tap"
+ echo "brew install --cask puremac"
+ echo "\`\`\`"
+ } > "${NOTES_FILE}"
+
+ if gh release view "${TAG}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
+ gh release upload "${TAG}" \
+ "build/PureMac-${VERSION}.dmg" \
+ "build/PureMac-${VERSION}.zip" \
+ --repo "${GITHUB_REPOSITORY}" --clobber
+ else
+ gh release create "${TAG}" \
+ "build/PureMac-${VERSION}.dmg" \
+ "build/PureMac-${VERSION}.zip" \
+ --title "PureMac ${TAG}" \
+ --notes-file "${NOTES_FILE}" \
+ --repo "${GITHUB_REPOSITORY}"
+ fi
+
+ - name: Bump in-repo homebrew formula
+ if: ${{ github.event_name == 'push' || inputs.dry_run == false }}
+ env:
+ VERSION: ${{ steps.ver.outputs.version }}
+ ZIP_SHA: ${{ steps.sha.outputs.zip }}
+ run: |
+ set -euo pipefail
+ FORMULA=homebrew/puremac.rb
+ /usr/bin/sed -i '' -E "s/^ version \".*\"/ version \"${VERSION}\"/" "${FORMULA}"
+ /usr/bin/sed -i '' -E "s/^ sha256 \".*\"/ sha256 \"${ZIP_SHA}\"/" "${FORMULA}"
+ git config user.name "github-actions[bot]"
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
+ git add "${FORMULA}"
+ if git diff --cached --quiet; then
+ echo "No formula changes to commit."
+ else
+ git commit -m "homebrew: bump to ${VERSION} (sha256 ${ZIP_SHA:0:12})"
+ git push origin HEAD:main
+ fi
+
+ - name: Bump tap formula (momenbasel/homebrew-tap)
+ if: ${{ (github.event_name == 'push' || inputs.dry_run == false) && env.HOMEBREW_TAP_TOKEN != '' }}
+ env:
+ HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
+ VERSION: ${{ steps.ver.outputs.version }}
+ ZIP_SHA: ${{ steps.sha.outputs.zip }}
+ run: |
+ set -euo pipefail
+ TAP_DIR="${RUNNER_TEMP}/homebrew-tap"
+ git clone "https://x-access-token:${HOMEBREW_TAP_TOKEN}@github.com/momenbasel/homebrew-tap.git" "${TAP_DIR}"
+ cd "${TAP_DIR}"
+ # Cask path may be Casks/puremac.rb or puremac.rb depending on tap layout
+ FORMULA=$(find . -name 'puremac.rb' -not -path './.git/*' | head -1)
+ if [[ -z "${FORMULA}" ]]; then
+ echo "::error::puremac.rb not found in tap"
+ exit 1
+ fi
+ /usr/bin/sed -i '' -E "s/^ version \".*\"/ version \"${VERSION}\"/" "${FORMULA}"
+ /usr/bin/sed -i '' -E "s/^ sha256 \".*\"/ sha256 \"${ZIP_SHA}\"/" "${FORMULA}"
+ git config user.name "github-actions[bot]"
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
+ git add "${FORMULA}"
+ if git diff --cached --quiet; then
+ echo "No tap formula changes."
+ else
+ git commit -m "puremac: bump to ${VERSION}"
+ git push origin HEAD
+ fi
+
+ - name: Cleanup keychain
+ if: always()
+ run: security delete-keychain "${RUNNER_TEMP}/app-signing.keychain-db" || true
diff --git a/project.yml b/project.yml
index 0dce9c2..41c7d21 100644
--- a/project.yml
+++ b/project.yml
@@ -19,8 +19,8 @@ settings:
CODE_SIGN_ENTITLEMENTS: "PureMac/PureMac.entitlements"
INFOPLIST_FILE: "PureMac/Info.plist"
PRODUCT_BUNDLE_IDENTIFIER: "com.puremac.app"
- MARKETING_VERSION: "2.1.0"
- CURRENT_PROJECT_VERSION: "5"
+ MARKETING_VERSION: "2.2.0"
+ CURRENT_PROJECT_VERSION: "6"
GENERATE_INFOPLIST_FILE: "NO"
ASSETCATALOG_COMPILER_APPICON_NAME: "AppIcon"
COMBINE_HIDPI_IMAGES: "YES"
diff --git a/scripts/SECRETS.md b/scripts/SECRETS.md
new file mode 100644
index 0000000..38e8915
--- /dev/null
+++ b/scripts/SECRETS.md
@@ -0,0 +1,113 @@
+# Release pipeline secrets
+
+`.github/workflows/release.yml` requires the following GitHub Actions secrets
+on `momenbasel/PureMac`. All seven must be set before the next tag push or the
+notarize/staple steps will fail and ship a broken signature (the cause of #86).
+
+## Required secrets
+
+| Secret | Source | Notes |
+|--------|--------|-------|
+| `BUILD_CERTIFICATE_BASE64` | Developer ID Application `.p12` exported from Keychain Access, `base64 -i cert.p12 \| pbcopy` | Includes both cert and private key |
+| `P12_PASSWORD` | Password set when exporting the `.p12` | Choose a strong random one |
+| `KEYCHAIN_PASSWORD` | Random string | Only used to lock the runner's temp keychain — never leaves CI |
+| `APPLE_ID` | The Apple ID email used for App Store Connect | e.g. `[email protected]` |
+| `APPLE_APP_PASSWORD` | App-specific password from <https://appleid.apple.com/account/manage> → Sign-In and Security → App-Specific Passwords | NOT your AppleID password |
+| `APPLE_TEAM_ID` | `H3WXHVTP97` (already set in workflow as env, no secret needed unless you want to override) | — |
+| `HOMEBREW_TAP_TOKEN` | Fine-grained PAT with `Contents: read+write` on `momenbasel/homebrew-tap` | Needed for the cross-repo formula bump step |
+
+## Extracting your Developer ID cert as `.p12`
+
+```bash
+# 1. Open Keychain Access → login keychain → "My Certificates"
+# 2. Right-click "Developer ID Application: Moamen Basel (H3WXHVTP97)" → Export
+# 3. Save as PureMac-DeveloperID.p12, set P12_PASSWORD when prompted
+
+# 4. Convert to base64 for the GH secret:
+base64 -i ~/Downloads/PureMac-DeveloperID.p12 | pbcopy
+# now paste into BUILD_CERTIFICATE_BASE64
+```
+
+CLI alternative (no GUI):
+
+```bash
+security find-certificate -c "Developer ID Application: Moamen Basel" -p login.keychain
+# To export the matching private key as p12 you still need the GUI - macOS
+# does not let `security export` dump private keys non-interactively.
+```
+
+## Generating the app-specific password
+
+1. Sign in at <https://appleid.apple.com>
+2. Sign-In and Security → App-Specific Passwords → +
+3. Label it `PureMac CI Notarytool`
+4. Copy the `xxxx-xxxx-xxxx-xxxx` string — set as `APPLE_APP_PASSWORD`
+
+Verify locally first to avoid burning a CI minute on auth failure:
+
+```bash
+xcrun notarytool store-credentials puremac-ci \
+ --apple-id "$APPLE_ID" \
+ --team-id "H3WXHVTP97" \
+ --password "$APPLE_APP_PASSWORD"
+```
+
+## Setting them all via gh CLI
+
+```bash
+gh secret set BUILD_CERTIFICATE_BASE64 --repo momenbasel/PureMac < /tmp/cert.b64
+gh secret set P12_PASSWORD --repo momenbasel/PureMac --body "$P12_PASSWORD"
+gh secret set KEYCHAIN_PASSWORD --repo momenbasel/PureMac --body "$(openssl rand -base64 32)"
+gh secret set APPLE_ID --repo momenbasel/PureMac --body "$APPLE_ID"
+gh secret set APPLE_APP_PASSWORD --repo momenbasel/PureMac --body "$APPLE_APP_PASSWORD"
+gh secret set HOMEBREW_TAP_TOKEN --repo momenbasel/PureMac --body "$HOMEBREW_TAP_TOKEN"
+
+# Verify:
+gh secret list --repo momenbasel/PureMac
+```
+
+## Triggering a release
+
+After tag bump:
+
+```bash
+git tag v2.2.0
+git push origin v2.2.0
+```
+
+Or via dispatch (no tag):
+
+```bash
+gh workflow run release.yml --repo momenbasel/PureMac -f version=2.2.0 -f dry_run=false
+```
+
+Use `dry_run=true` first to validate signing+notarize without uploading the
+release or bumping homebrew.
+
+## What ships
+
+| Artifact | Purpose |
+|----------|---------|
+| `PureMac-X.Y.Z.dmg` | Direct download link in release notes (signed + notarized + stapled) |
+| `PureMac-X.Y.Z.zip` | Source for the homebrew cask (notarized + stapled `.app` inside) |
+
+Both checksums land in `build/CHECKSUMS.md` and the GH release body.
+
+## Troubleshooting #86 (`code or signature have been modified`)
+
+Root causes that the pipeline guards against, that the previous manual
+release path did not:
+
+- Files modified after `codesign` (e.g. running `xcodegen` post-sign breaks the
+ signature). The pipeline runs `xcodegen` before `archive` and never edits the
+ bundle after the export step.
+- Notarizing the `.app` but shipping a `.zip` made before the staple. The
+ pipeline staples the `.app` first, then re-zips it. Order matters — Gatekeeper
+ on first launch checks the stapled ticket on the `.app`, not the zip.
+- Using `Apple Development` cert (default in `project.yml`) for distribution —
+ the pipeline overrides with `Developer ID Application` at archive time.
+- Skipping `--options=runtime` (no hardened runtime → notary rejects). Pipeline
+ passes it via `OTHER_CODE_SIGN_FLAGS`.
+- Universal-binary signing race where `lipo` is run after sign. The archive
+ step builds universal in one pass via `ARCHS="arm64 x86_64"` so the codesign
+ covers both slices atomically.
diff --git a/scripts/release-local.sh b/scripts/release-local.sh
new file mode 100755
index 0000000..be38db5
--- /dev/null
+++ b/scripts/release-local.sh
@@ -0,0 +1,125 @@
+#!/usr/bin/env bash
+#
+# Local mirror of .github/workflows/release.yml. Use for emergency hotfixes
+# when CI is unavailable. Requires:
+# - Developer ID Application identity in your login keychain
+# - APPLE_ID, APPLE_APP_PASSWORD env vars (or notarytool keychain profile)
+# - xcodegen + create-dmg installed (brew install xcodegen create-dmg)
+#
+# Usage: scripts/release-local.sh <version>
+# scripts/release-local.sh 2.2.0
+#
+set -euo pipefail
+
+VERSION="${1:?Usage: $0 <version>}"
+TEAM_ID="H3WXHVTP97"
+SIGN_ID="Developer ID Application: Moamen Basel (${TEAM_ID})"
+SCHEME="PureMac"
+PROJECT="PureMac.xcodeproj"
+APP="build/export/PureMac.app"
+DMG="build/PureMac-${VERSION}.dmg"
+ZIP="build/PureMac-${VERSION}.zip"
+
+cd "$(dirname "$0")/.."
+
+PROJ_VERSION=$(grep -E '^\s*MARKETING_VERSION:' project.yml | sed -E 's/.*"([^"]+)".*/\1/')
+if [[ "${PROJ_VERSION}" != "${VERSION}" ]]; then
+ echo "ERROR: project.yml MARKETING_VERSION (${PROJ_VERSION}) != ${VERSION}" >&2
+ exit 1
+fi
+
+rm -rf build
+mkdir -p build
+
+echo "==> xcodegen"
+xcodegen generate
+
+echo "==> archive"
+xcodebuild \
+ -project "${PROJECT}" \
+ -scheme "${SCHEME}" \
+ -configuration Release \
+ -destination 'generic/platform=macOS' \
+ -archivePath build/PureMac.xcarchive \
+ ARCHS="arm64 x86_64" \
+ ONLY_ACTIVE_ARCH=NO \
+ CODE_SIGN_STYLE=Manual \
+ CODE_SIGN_IDENTITY="${SIGN_ID}" \
+ DEVELOPMENT_TEAM="${TEAM_ID}" \
+ OTHER_CODE_SIGN_FLAGS="--timestamp --options=runtime" \
+ archive
+
+echo "==> export"
+cat > build/ExportOptions.plist <<PLIST
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>method</key><string>developer-id</string>
+ <key>teamID</key><string>${TEAM_ID}</string>
+ <key>signingStyle</key><string>manual</string>
+ <key>signingCertificate</key><string>Developer ID Application</string>
+</dict>
+</plist>
+PLIST
+
+xcodebuild -exportArchive \
+ -archivePath build/PureMac.xcarchive \
+ -exportPath build/export \
+ -exportOptionsPlist build/ExportOptions.plist
+
+echo "==> verify codesign"
+codesign --verify --deep --strict --verbose=2 "${APP}"
+codesign -dvv "${APP}" 2>&1 | grep -E "Identifier|TeamIdentifier|flags|Authority"
+codesign -dvv "${APP}" 2>&1 | grep -q "flags=0x10000(runtime)" || { echo "Hardened runtime missing"; exit 1; }
+lipo -archs "${APP}/Contents/MacOS/PureMac"
+
+echo "==> dmg"
+create-dmg \
+ --volname "PureMac ${VERSION}" \
+ --window-size 540 360 \
+ --icon-size 100 \
+ --icon "PureMac.app" 140 180 \
+ --hide-extension "PureMac.app" \
+ --app-drop-link 400 180 \
+ --no-internet-enable \
+ "${DMG}" \
+ build/export/PureMac.app
+codesign --sign "${SIGN_ID}" --timestamp "${DMG}"
+
+echo "==> notarize app zip"
+ditto -c -k --keepParent --sequesterRsrc "${APP}" build/PureMac-app.zip
+xcrun notarytool submit build/PureMac-app.zip \
+ --apple-id "${APPLE_ID:?set APPLE_ID env var}" \
+ --password "${APPLE_APP_PASSWORD:?set APPLE_APP_PASSWORD env var}" \
+ --team-id "${TEAM_ID}" \
+ --wait --timeout 30m
+xcrun stapler staple "${APP}"
+
+echo "==> notarize dmg"
+xcrun notarytool submit "${DMG}" \
+ --apple-id "${APPLE_ID}" \
+ --password "${APPLE_APP_PASSWORD}" \
+ --team-id "${TEAM_ID}" \
+ --wait --timeout 30m
+xcrun stapler staple "${DMG}"
+xcrun stapler validate "${DMG}"
+spctl --assess --type install --verbose=4 "${DMG}"
+
+echo "==> final zip with stapled app"
+ditto -c -k --keepParent --sequesterRsrc "${APP}" "${ZIP}"
+
+DMG_SHA=$(shasum -a 256 "${DMG}" | awk '{print $1}')
+ZIP_SHA=$(shasum -a 256 "${ZIP}" | awk '{print $1}')
+
+echo ""
+echo "===================="
+echo "PureMac ${VERSION} signed + notarized"
+echo "===================="
+echo "DMG: ${DMG}"
+echo " sha256: ${DMG_SHA}"
+echo "ZIP: ${ZIP}"
+echo " sha256: ${ZIP_SHA}"
+echo ""
+echo "Next: gh release create v${VERSION} ${DMG} ${ZIP} --title \"PureMac v${VERSION}\""
+echo "Then: bump homebrew/puremac.rb sha256 to ${ZIP_SHA}"