File tree Expand file tree Collapse file tree
.github/actions/create-dmg Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737 # Copy background image if provided and exists
3838 if [ -f "${{ inputs.dmg_background_path }}" ]; then
3939 cp "${{ inputs.dmg_background_path }}" "dmg-stage/background.jpg"
40- # Resize background to match window size exactly (700x500)
41- sips -z 500 700 "dmg-stage/background.jpg"
40+
41+ # Check image width to determine if it's Retina (@2x) (1400px)
42+ WIDTH=$(sips -g pixelWidth "dmg-stage/background.jpg" | awk '/pixelWidth/ {print $2}')
43+
44+ if [ "$WIDTH" -gt 700 ]; then
45+ echo "Detected high-resolution background ($WIDTH px width). Setting DPI to 144 for Retina display."
46+ sips -s dpiHeight 144.0 -s dpiWidth 144.0 "dmg-stage/background.jpg"
47+ else
48+ echo "Detected standard-resolution background ($WIDTH px width). Keeping standard DPI."
49+ sips -s dpiHeight 72.0 -s dpiWidth 72.0 "dmg-stage/background.jpg"
50+ fi
4251 else
4352 echo "::warning::Background image not found at ${{ inputs.dmg_background_path }}. DMG will be created without custom background."
4453 fi
6069 --icon "CopyShot.app" 180 225
6170 --icon "Applications" 520 225
6271 --hide-extension "CopyShot.app"
72+ --no-toolbar
6373 )
6474
6575 if [ -f "dmg-stage/background.jpg" ]; then
You can’t perform that action at this time.
0 commit comments