Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
appimage/friture.yml text eol=lf
appimage/friture.desktop text eol=lf
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
50 changes: 26 additions & 24 deletions .github/workflows/install-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tools/*
friture.egg-info
.eggs/
*.appx
*.msix

##################
# IDE files
Expand All @@ -44,4 +45,5 @@ Notepad++
.mypy_cache

# Macos
.DS_Store
.DS_Store
*.dmg
Binary file added installer/dmg-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 88 additions & 0 deletions installer/dmg-background.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed installer/icudt53.dll
Binary file not shown.
Loading