@@ -38,7 +38,6 @@ VERSION="$(node -p "require('$ROOT/src-tauri/tauri.conf.json').version")"
3838TAG=" v$VERSION "
3939BUNDLE=" $ROOT /src-tauri/target/universal-apple-darwin/release/bundle"
4040APP=" $BUNDLE /macos/MyDevTools.app"
41- TARBALL_NAME=" MyDevTools_${VERSION} _universal.app.tar.gz"
4241DMG=" $BUNDLE /dmg/MyDevTools_${VERSION} _universal.dmg"
4342OUT=" $BUNDLE /macos"
4443
@@ -55,27 +54,32 @@ if gh release view "$TAG" --repo "$PUBLIC_REPO" >/dev/null 2>&1; then
5554 exit 1
5655fi
5756
58- # ── 1. build + Apple-sign the universal app (no dmg — we make it via hdiutil) ─
59- echo " ▸ [1/6] Building & signing the app…"
60- ( cd " $ROOT " && pnpm tauri build --bundles app --target universal-apple-darwin )
57+ # ── 1. build: Apple-sign the app AND sign the updater payload ─────────────────
58+ # createUpdaterArtifacts:true makes tauri build emit + sign the .app.tar.gz, so
59+ # TAURI_SIGNING_PRIVATE_KEY must be set here. Letting Tauri produce the tarball
60+ # guarantees it's in the exact format its updater expects.
61+ echo " ▸ [1/5] Building & signing the app + updater payload…"
62+ ( cd " $ROOT " && \
63+ TAURI_SIGNING_PRIVATE_KEY=" $( cat " $KEYFILE " ) " \
64+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD=" $PW " \
65+ pnpm tauri build --bundles app --target universal-apple-darwin )
6166
62- # ── 2. notarize + staple the .app (so both the tarball and dmg carry a ticket)─
63- echo " ▸ [2/6] Notarizing & stapling the app…"
67+ # Locate the updater artifacts Tauri just produced (name varies by version).
68+ TARGZ=" $( ls " $OUT " /* .app.tar.gz 2> /dev/null | head -1) "
69+ SIG=" ${TARGZ} .sig"
70+ TARBALL_NAME=" $( basename " $TARGZ " ) "
71+ [ -f " $TARGZ " ] && [ -f " $SIG " ] || { echo " release-local: updater artifacts not found in $OUT " >&2 ; exit 1; }
72+
73+ # ── 2. notarize + staple the .app (for the DMG download path) ─────────────────
74+ echo " ▸ [2/5] Notarizing & stapling the app…"
6475APP_ZIP=" $( mktemp -d) /app.zip"
6576ditto -c -k --keepParent " $APP " " $APP_ZIP "
6677xcrun notarytool submit " $APP_ZIP " --keychain-profile " $NOTARY_PROFILE " --wait
6778xcrun stapler staple " $APP "
6879rm -f " $APP_ZIP "
6980
70- # ── 3. updater payload: tar the stapled app, then sign it with the updater key ─
71- echo " ▸ [3/6] Building & signing the updater payload…"
72- rm -f " $OUT /$TARBALL_NAME " " $OUT /$TARBALL_NAME .sig"
73- # COPYFILE_DISABLE strips macOS AppleDouble (._*) entries the updater can't use.
74- COPYFILE_DISABLE=1 tar -czf " $OUT /$TARBALL_NAME " -C " $( dirname " $APP " ) " " $( basename " $APP " ) "
75- npx tauri signer sign -f " $KEYFILE " -p " $PW " " $OUT /$TARBALL_NAME " # -> $TARBALL_NAME.sig
76-
77- # ── 4. DMG for fresh downloads: hdiutil (deterministic), sign, notarize, staple ─
78- echo " ▸ [4/6] Building, signing & notarizing the DMG…"
81+ # ── 3. DMG for fresh downloads: hdiutil (deterministic), sign, notarize, staple ─
82+ echo " ▸ [3/5] Building, signing & notarizing the DMG…"
7983mkdir -p " $BUNDLE /dmg"
8084STAGE=" $( mktemp -d) "
8185cp -R " $APP " " $STAGE /"
@@ -87,10 +91,10 @@ codesign --force --sign "$APPLE_SIGNING_IDENTITY" "$DMG"
8791xcrun notarytool submit " $DMG " --keychain-profile " $NOTARY_PROFILE " --wait
8892xcrun stapler staple " $DMG "
8993
90- # ── 5 . latest.json: manifest the updater reads (signature + public URL) ───────
91- echo " ▸ [5/6 ] Writing latest.json…"
94+ # ── 4 . latest.json: manifest the updater reads (signature + public URL) ───────
95+ echo " ▸ [4/5 ] Writing latest.json…"
9296LATEST=" $OUT /latest.json"
93- SIG_CONTENT=" $( cat " $OUT / $TARBALL_NAME .sig " ) " \
97+ SIG_CONTENT=" $( cat " $SIG " ) " \
9498TARGZ_URL=" https://github.com/$PUBLIC_REPO /releases/download/$TAG /$TARBALL_NAME " \
9599VERSION=" $VERSION " \
96100PUBDATE=" $( date -u +%Y-%m-%dT%H:%M:%SZ) " \
@@ -112,12 +116,12 @@ node -e '
112116 fs.writeFileSync(process.env.LATEST_OUT, JSON.stringify(manifest, null, 2));
113117'
114118
115- # ── 6 . publish everything to the PUBLIC repo ─────────────────────────────────
116- echo " ▸ [6/6 ] Publishing to $PUBLIC_REPO … "
119+ # ── 5 . publish everything to the PUBLIC repo ─────────────────────────────────
120+ echo " ▸ [5/5 ] Publishing to ${ PUBLIC_REPO} ... "
117121gh release create " $TAG " --repo " $PUBLIC_REPO " \
118122 --title " MyDevTools $TAG " --notes " MyDevTools desktop $TAG "
119123gh release upload " $TAG " --repo " $PUBLIC_REPO " --clobber \
120- " $DMG " " $OUT / $TARBALL_NAME " " $OUT / $TARBALL_NAME .sig " " $LATEST "
124+ " $DMG " " $TARGZ " " $SIG " " $LATEST "
121125
122126echo " "
123127echo " ✅ Published v$VERSION . Installed apps will offer the update on next launch."
0 commit comments