diff --git a/.gitattributes b/.gitattributes index 241eeaea..b66a5e6d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1 @@ -appimage/friture.yml text eol=lf appimage/friture.desktop text eol=lf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1dad69d6..dbfa0f99 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -192,6 +192,33 @@ jobs: - name: Build run: source ./.github/workflows/install-macos.sh + - name: Verify app launches (smoke test) + shell: bash + run: uv run python scripts/smoke_test.py dist/friture.app/Contents/MacOS/friture --no-splash + + - name: Capture Friture log + if: always() + shell: bash + run: | + uv run python - <<'PY' + import os, shutil, platformdirs + src = os.path.join(platformdirs.user_log_dir("Friture", ""), "friture.log.txt") + dst = "friture-smoke.log" + if os.path.exists(src): + shutil.copy2(src, dst) + else: + with open(dst, "w") as f: + f.write("log not found: " + src) + PY + + - name: Upload friture smoke-test log + if: always() + uses: actions/upload-artifact@v7 + with: + name: friture-smoke-log-macos + path: friture-smoke.log + if-no-files-found: warn + - name: Upload dmg uses: actions/upload-artifact@v7 with: diff --git a/.github/workflows/install-macos.sh b/.github/workflows/install-macos.sh index 00230a7b..1c948a2c 100644 --- a/.github/workflows/install-macos.sh +++ b/.github/workflows/install-macos.sh @@ -37,31 +37,33 @@ codesign -dv dist/friture.app export ARTIFACT_FILENAME=friture-$(uv run python -c 'import friture; print(friture.__version__)')-$(date +'%Y%m%d').dmg echo $ARTIFACT_FILENAME -# macos has random hdiutil errors because of XProtectBehaviorService, retry a few times. -# Reference: https://github.com/actions/runner-images/issues/7522#issuecomment-1556766641 -max_retries=30 -retry_delay_seconds=5 +# sanity check: a healthy Friture .app bundle is well under 200 MB. +# A much larger result usually means a packaging step duplicated the Qt/Python +# libs, so fail loudly rather than ship a bloated artifact. +APP_BUNDLE_SIZE_BYTES=$(du -sk dist/friture.app | awk '{print $1}') +echo "friture.app size: $APP_BUNDLE_SIZE_BYTES KB" +if [ "$APP_BUNDLE_SIZE_BYTES" -gt 200000 ]; then + echo "ERROR: friture.app is unexpectedly large (>200MB); aborting." + exit 1 +fi -for ((i=1; i<=max_retries; i++)); do - set +e # Disable 'exit on error' - hdiutil create $ARTIFACT_FILENAME -volname "Friture" -fs HFS+ -srcfolder dist/friture.app - status=$? - set -e # Re-enable 'exit on error' +# Build the DMG with a polished layout (icon positioning + a drop zone for +# /Applications) using create-dmg. +brew install create-dmg - if [ $status -eq 0 ]; then - echo "hdiutil create succeeded on attempt $i" - break - else - echo "hdiutil create failed on attempt $i" - if [ $i -lt $max_retries ]; then - echo "Retrying in $retry_delay_seconds seconds..." - sleep $retry_delay_seconds - else - echo "All attempts failed." - exit 1 - fi - fi -done +create-dmg \ + --volname "Friture" \ + --window-pos 200 122 \ + --window-size 600 400 \ + --icon-size 100 \ + --hide-extension "friture.app" \ + --icon "friture.app" 150 190 \ + --app-drop-link 450 190 \ + --background "installer/dmg-background.png" \ + --hdiutil-retries 30 \ + --no-internet-enable \ + "$ARTIFACT_FILENAME" \ + dist/friture.app du -hs dist/friture.app -du -hs $ARTIFACT_FILENAME +du -hs "$ARTIFACT_FILENAME" diff --git a/.gitignore b/.gitignore index bf189e16..c073dc65 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ tools/* friture.egg-info .eggs/ *.appx +*.msix ################## # IDE files @@ -44,4 +45,5 @@ Notepad++ .mypy_cache # Macos -.DS_Store \ No newline at end of file +.DS_Store +*.dmg \ No newline at end of file diff --git a/installer/dmg-background.png b/installer/dmg-background.png new file mode 100644 index 00000000..d03bb65d Binary files /dev/null and b/installer/dmg-background.png differ diff --git a/installer/dmg-background.svg b/installer/dmg-background.svg new file mode 100644 index 00000000..b5bb35b0 --- /dev/null +++ b/installer/dmg-background.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + + diff --git a/installer/icudt53.dll b/installer/icudt53.dll deleted file mode 100644 index 6e4a244c..00000000 Binary files a/installer/icudt53.dll and /dev/null differ