Skip to content

Commit 454f1fb

Browse files
committed
fix v5
1 parent 3db50a6 commit 454f1fb

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

.github/actions/create-dmg/action.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ runs:
3434
cp -R "${{ inputs.app_path }}" "dmg-stage/CopyShot.app"
3535
ln -s /Applications "dmg-stage/Applications"
3636
37+
# Create a hidden .background directory
38+
mkdir -p "dmg-stage/.background"
39+
3740
# Copy background image if provided and exists
3841
if [ -f "${{ inputs.dmg_background_path }}" ]; then
3942
# Check image width to determine if it's Retina (@2x)
@@ -43,16 +46,15 @@ runs:
4346
echo "Detected high-resolution background ($WIDTH px width). Creating multi-resolution TIFF."
4447
4548
# Create a temporary downscaled 1x version (700x500)
46-
sips -z 500 700 "${{ inputs.dmg_background_path }}" --out "dmg-stage/background_1x.jpg"
49+
sips -z 500 700 "${{ inputs.dmg_background_path }}" --out "dmg-stage/.background/background_1x.jpg"
4750
4851
# Combine original (2x) and downscaled (1x) into a multi-resolution TIFF
49-
# @2x image must be named with @2x for some tools, but tiffutil -cathidpi loves simple inputs
50-
tiffutil -cathidpicheck "dmg-stage/background_1x.jpg" "${{ inputs.dmg_background_path }}" -out "dmg-stage/background.tiff"
52+
tiffutil -cathidpicheck "dmg-stage/.background/background_1x.jpg" "${{ inputs.dmg_background_path }}" -out "dmg-stage/.background/background.tiff"
5153
5254
echo "Created multi-resolution background.tiff"
5355
else
5456
echo "Detected standard-resolution background ($WIDTH px width). Using as-is."
55-
cp "${{ inputs.dmg_background_path }}" "dmg-stage/background.tiff"
57+
cp "${{ inputs.dmg_background_path }}" "dmg-stage/.background/background.tiff"
5658
fi
5759
else
5860
echo "::warning::Background image not found at ${{ inputs.dmg_background_path }}. DMG will be created without custom background."
@@ -77,8 +79,8 @@ runs:
7779
--hide-extension "CopyShot.app"
7880
)
7981
80-
if [ -f "dmg-stage/background.tiff" ]; then
81-
ARGS+=(--background "dmg-stage/background.tiff")
82+
if [ -f "dmg-stage/.background/background.tiff" ]; then
83+
ARGS+=(--background "dmg-stage/.background/background.tiff")
8284
fi
8385
8486
# Window and icon sizes/positions are in pixels.

0 commit comments

Comments
 (0)