Skip to content

Commit c8d44f2

Browse files
Nishanthclaude
andcommitted
desktop: bump to 0.1.9 + harden release-local.sh
Make local releases self-healing: prune old DMGs at start (avoid disk-full), trap-clean the staging workdir on any exit, and retry codesign on transient timestamp.apple.com failures. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent f1b7b98 commit c8d44f2

5 files changed

Lines changed: 28 additions & 7 deletions

File tree

apps/desktop/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mydevtools/desktop",
3-
"version": "0.1.8",
3+
"version": "0.1.9",
44
"private": true,
55
"scripts": {
66
"dev": "tauri dev",

apps/desktop/scripts/release-local.sh

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,26 @@ if gh release view "$TAG" --repo "$PUBLIC_REPO" >/dev/null 2>&1; then
5454
exit 1
5555
fi
5656

57+
# Reclaim disk: old DMGs from prior builds are already published — drop them so
58+
# the target dir doesn't fill up (hdiutil fails with "No space left on device").
59+
rm -f "$BUNDLE"/dmg/MyDevTools_*_universal.dmg "$BUNDLE"/dmg/MyDevTools.dmg 2>/dev/null || true
60+
# Single staging workdir, cleaned on ANY exit (so a mid-run failure doesn't leak
61+
# ~90MB of copied .app each time).
62+
WORK="$(mktemp -d)"
63+
trap 'rm -rf "$WORK"' EXIT
64+
65+
# Sign a file with a Developer ID + secure timestamp, retrying transient
66+
# timestamp.apple.com failures ("A timestamp was expected but was not found").
67+
codesign_retry() {
68+
local target="$1" i
69+
for i in 1 2 3 4 5; do
70+
if codesign --force --timestamp --sign "$APPLE_SIGNING_IDENTITY" "$target" 2>/tmp/cs_err; then return 0; fi
71+
echo " codesign attempt $i failed: $(cat /tmp/cs_err) — retrying in 10s…" >&2
72+
sleep 10
73+
done
74+
echo "release-local: codesign failed after 5 attempts" >&2; return 1
75+
}
76+
5777
# ── 1. build: Apple-sign the app AND sign the updater payload ─────────────────
5878
# createUpdaterArtifacts:true makes tauri build emit + sign the .app.tar.gz, so
5979
# TAURI_SIGNING_PRIVATE_KEY must be set here. Letting Tauri produce the tarball
@@ -72,7 +92,7 @@ TARBALL_NAME="$(basename "$TARGZ")"
7292

7393
# ── 2. notarize + staple the .app (for the DMG download path) ─────────────────
7494
echo "▸ [2/5] Notarizing & stapling the app…"
75-
APP_ZIP="$(mktemp -d)/app.zip"
95+
APP_ZIP="$WORK/app.zip"
7696
ditto -c -k --keepParent "$APP" "$APP_ZIP"
7797
xcrun notarytool submit "$APP_ZIP" --keychain-profile "$NOTARY_PROFILE" --wait
7898
xcrun stapler staple "$APP"
@@ -81,13 +101,14 @@ rm -f "$APP_ZIP"
81101
# ── 3. DMG for fresh downloads: hdiutil (deterministic), sign, notarize, staple ─
82102
echo "▸ [3/5] Building, signing & notarizing the DMG…"
83103
mkdir -p "$BUNDLE/dmg"
84-
STAGE="$(mktemp -d)"
104+
STAGE="$WORK/stage"
105+
mkdir -p "$STAGE"
85106
cp -R "$APP" "$STAGE/"
86107
ln -s /Applications "$STAGE/Applications"
87108
rm -f "$DMG"
88109
hdiutil create -volname "MyDevTools" -srcfolder "$STAGE" -ov -format UDZO "$DMG" >/dev/null
89110
rm -rf "$STAGE"
90-
codesign --force --sign "$APPLE_SIGNING_IDENTITY" "$DMG"
111+
codesign_retry "$DMG"
91112
xcrun notarytool submit "$DMG" --keychain-profile "$NOTARY_PROFILE" --wait
92113
xcrun stapler staple "$DMG"
93114

apps/desktop/src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/desktop/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mydevtools-desktop"
3-
version = "0.1.8"
3+
version = "0.1.9"
44
description = "MyDevTools desktop app"
55
edition = "2021"
66

apps/desktop/src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "MyDevTools",
4-
"version": "0.1.8",
4+
"version": "0.1.9",
55
"identifier": "tech.mydevtools.desktop",
66
"build": {
77
"beforeDevCommand": "pnpm --filter @mydevtools/desktop-ui dev:tauri",

0 commit comments

Comments
 (0)