@@ -45,13 +45,10 @@ TSA_URL="http://ts.ssl.com"
4545# GitHub repo
4646GITHUB_REPO=" diffplug/mouseterm"
4747
48- # Stable filenames for release assets
49- FNAME_WIN_EXE=" MouseTerm-windows-x64.exe"
50- FNAME_WIN_UPDATE=" MouseTerm-windows-x64.nsis.zip"
51- FNAME_MAC_DMG=" MouseTerm-macos-aarch64.dmg"
52- FNAME_MAC_UPDATE=" MouseTerm-macos-aarch64.tar.gz"
53- FNAME_LINUX_APPIMAGE=" MouseTerm-linux-x86_64.AppImage"
54- FNAME_LINUX_UPDATE=" MouseTerm-linux-x86_64.AppImage.tar.gz"
48+ # Stable filenames for release assets (update bundles only)
49+ FNAME_WIN=" MouseTerm-windows-x64.nsis.zip"
50+ FNAME_MAC=" MouseTerm-macos-aarch64.tar.gz"
51+ FNAME_LINUX=" MouseTerm-linux-x86_64.AppImage.tar.gz"
5552
5653# =============================================================================
5754# Helper Functions
@@ -447,18 +444,8 @@ notarize_macos() {
447444 local app_name
448445 app_name=$( basename " $app " )
449446
450- log " Creating $FNAME_MAC_DMG ..."
451- local dmg_stage=" $SIGN_DIR /dmg-stage"
452- rm -rf " $dmg_stage "
453- mkdir -p " $dmg_stage "
454- cp -R " $app " " $dmg_stage /"
455- ln -s /Applications " $dmg_stage /Applications"
456- hdiutil create -volname " MouseTerm" -srcfolder " $dmg_stage " \
457- -ov -format UDZO " $SIGN_DIR /$FNAME_MAC_DMG "
458- rm -rf " $dmg_stage "
459-
460- log " Creating $FNAME_MAC_UPDATE ..."
461- tar -czf " $SIGN_DIR /$FNAME_MAC_UPDATE " -C " $( dirname " $app " ) " " $app_name "
447+ log " Creating $FNAME_MAC ..."
448+ tar -czf " $SIGN_DIR /$FNAME_MAC " -C " $( dirname " $app " ) " " $app_name "
462449 fi
463450
464451 log " All macOS notarization and packaging complete"
@@ -503,8 +490,6 @@ sign_windows() {
503490 --tsmode RFC3161 \
504491 " $installer_path "
505492
506- # Copy with stable filename
507- cp " $installer_path " " $SIGN_DIR /$FNAME_WIN_EXE "
508493 fi
509494
510495 log " Windows signing complete"
@@ -524,55 +509,42 @@ sign_updates() {
524509 local release_dir=" $WORK_DIR /release-assets"
525510 mkdir -p " $release_dir "
526511
527- # Collect and rename update bundles with stable filenames
528- # macOS .tar.gz (already created by notarize step)
529- [[ -f " $SIGN_DIR /$FNAME_MAC_UPDATE " ]] && cp " $SIGN_DIR /$FNAME_MAC_UPDATE " " $release_dir /"
530- [[ -f " $SIGN_DIR /$FNAME_MAC_DMG " ]] && cp " $SIGN_DIR /$FNAME_MAC_DMG " " $release_dir /"
512+ # Collect update bundles with stable filenames
513+ # macOS .tar.gz (created by notarize step from signed+notarized .app)
514+ [[ -f " $SIGN_DIR /$FNAME_MAC " ]] && cp " $SIGN_DIR /$FNAME_MAC " " $release_dir /"
531515
532- # Windows NSIS zip — rebuild with signed exe so Tauri auto-update gets the signed binary
516+ # Windows NSIS zip — rebuild with signed installer
533517 local win_nsis
534518 win_nsis=$( find " $SIGN_DIR /standalone-win-x64" -path " */updater-bundles/*.nsis.zip" -o -name " *.nsis.zip" | head -1)
535519 if [[ -n " $win_nsis " ]]; then
536- local signed_exe
537- signed_exe=$( find " $SIGN_DIR /standalone-win-x64" -name " MouseTerm.exe" -not -name " *setup*" -not -name " *install*" | head -1)
538- if [[ -n " $signed_exe " ]]; then
539- log " Rebuilding NSIS zip with signed executable..."
540- local nsis_tmp=" $SIGN_DIR /nsis-repack"
541- mkdir -p " $nsis_tmp "
542- unzip -o " $win_nsis " -d " $nsis_tmp "
543- # Replace the unsigned exe inside the extracted zip with the signed one
544- local inner_exe
545- inner_exe=$( find " $nsis_tmp " -name " MouseTerm.exe" -not -name " *setup*" -not -name " *install*" | head -1)
546- if [[ -n " $inner_exe " ]]; then
547- cp " $signed_exe " " $inner_exe "
548- # Rebuild the zip
549- (cd " $nsis_tmp " && zip -r " $release_dir /$FNAME_WIN_UPDATE " .)
550- else
551- warn " Could not find exe inside NSIS zip; copying original"
552- cp " $win_nsis " " $release_dir /$FNAME_WIN_UPDATE "
520+ log " Rebuilding NSIS zip with signed installer..."
521+ local signed_installer=" $SIGN_DIR /standalone-win-x64/bundle/nsis/"
522+ local nsis_tmp=" $SIGN_DIR /nsis-repack"
523+ mkdir -p " $nsis_tmp "
524+ unzip -o " $win_nsis " -d " $nsis_tmp "
525+ # Find the signed installer and replace the one in the zip
526+ local signed_setup
527+ signed_setup=$( find " $SIGN_DIR /standalone-win-x64" -name " *setup*.exe" | head -1)
528+ if [[ -n " $signed_setup " ]]; then
529+ local inner_setup
530+ inner_setup=$( find " $nsis_tmp " -name " *setup*.exe" | head -1)
531+ if [[ -n " $inner_setup " ]]; then
532+ cp " $signed_setup " " $inner_setup "
553533 fi
554- rm -rf " $nsis_tmp "
555- else
556- cp " $win_nsis " " $release_dir /$FNAME_WIN_UPDATE "
557534 fi
535+ (cd " $nsis_tmp " && zip -r " $release_dir /$FNAME_WIN " .)
536+ rm -rf " $nsis_tmp "
558537 fi
559538
560- # Windows installer
561- [[ -f " $SIGN_DIR /$FNAME_WIN_EXE " ]] && cp " $SIGN_DIR /$FNAME_WIN_EXE " " $release_dir /"
562-
563- # Linux AppImage
564- local linux_appimage
565- linux_appimage=$( find " $SIGN_DIR /standalone-linux-x64" -name " *.AppImage" -not -name " *.tar.gz" | head -1)
566- [[ -n " $linux_appimage " ]] && cp " $linux_appimage " " $release_dir /$FNAME_LINUX_APPIMAGE "
567-
539+ # Linux AppImage.tar.gz
568540 local linux_update
569541 linux_update=$( find " $SIGN_DIR /standalone-linux-x64" -path " */updater-bundles/*.AppImage.tar.gz" -o -name " *.AppImage.tar.gz" | head -1)
570- [[ -n " $linux_update " ]] && cp " $linux_update " " $release_dir /$FNAME_LINUX_UPDATE "
542+ [[ -n " $linux_update " ]] && cp " $linux_update " " $release_dir /$FNAME_LINUX "
571543
572544 # Generate .sig files for update bundles using Tauri CLI
573- for bundle in " $release_dir /$FNAME_MAC_UPDATE " \
574- " $release_dir /$FNAME_WIN_UPDATE " \
575- " $release_dir /$FNAME_LINUX_UPDATE " ; do
545+ for bundle in " $release_dir /$FNAME_MAC " \
546+ " $release_dir /$FNAME_WIN " \
547+ " $release_dir /$FNAME_LINUX " ; do
576548 if [[ -f " $bundle " ]]; then
577549 log " Tauri-signing: $( basename " $bundle " ) "
578550 # Use tauri signer to sign the bundle
@@ -591,9 +563,9 @@ sign_updates() {
591563
592564 # Read .sig file contents
593565 local sig_mac=" " sig_win=" " sig_linux=" "
594- [[ -f " $release_dir /$FNAME_MAC_UPDATE .sig" ]] && { sig_mac=$( cat " $release_dir /$FNAME_MAC_UPDATE .sig" ) ; rm " $release_dir /$FNAME_MAC_UPDATE .sig" ; }
595- [[ -f " $release_dir /$FNAME_WIN_UPDATE .sig" ]] && { sig_win=$( cat " $release_dir /$FNAME_WIN_UPDATE .sig" ) ; rm " $release_dir /$FNAME_WIN_UPDATE .sig" ; }
596- [[ -f " $release_dir /$FNAME_LINUX_UPDATE .sig" ]] && { sig_linux=$( cat " $release_dir /$FNAME_LINUX_UPDATE .sig" ) ; rm " $release_dir /$FNAME_LINUX_UPDATE .sig" ; }
566+ [[ -f " $release_dir /$FNAME_MAC .sig" ]] && { sig_mac=$( cat " $release_dir /$FNAME_MAC .sig" ) ; rm " $release_dir /$FNAME_MAC .sig" ; }
567+ [[ -f " $release_dir /$FNAME_WIN .sig" ]] && { sig_win=$( cat " $release_dir /$FNAME_WIN .sig" ) ; rm " $release_dir /$FNAME_WIN .sig" ; }
568+ [[ -f " $release_dir /$FNAME_LINUX .sig" ]] && { sig_linux=$( cat " $release_dir /$FNAME_LINUX .sig" ) ; rm " $release_dir /$FNAME_LINUX .sig" ; }
597569
598570 local website_manifest=" $REPO_ROOT /website/public/standalone-latest.json"
599571 cat > " $website_manifest " << EOF
@@ -603,15 +575,15 @@ sign_updates() {
603575 "pub_date": "$pub_date ",
604576 "platforms": {
605577 "darwin-aarch64": {
606- "url": "$base_url /$FNAME_MAC_UPDATE ",
578+ "url": "$base_url /$FNAME_MAC ",
607579 "signature": "$sig_mac "
608580 },
609581 "windows-x86_64": {
610- "url": "$base_url /$FNAME_WIN_UPDATE ",
582+ "url": "$base_url /$FNAME_WIN ",
611583 "signature": "$sig_win "
612584 },
613585 "linux-x86_64": {
614- "url": "$base_url /$FNAME_LINUX_UPDATE ",
586+ "url": "$base_url /$FNAME_LINUX ",
615587 "signature": "$sig_linux "
616588 }
617589 }
0 commit comments