Skip to content

Commit

Permalink
Add script to create+sign .dmg release to version control
Browse files Browse the repository at this point in the history
Added tiny, empty .dmg with placeholder .app for setting up the Finder
settings for the output .dmg. The script will then copy .dmg and grow it
in a tmp, then use that to build the final output.
  • Loading branch information
NHDaly committed May 5, 2018
1 parent fd3d7ea commit f2c3379
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Binary file added dmg/Paddle-Battle-rw.dmg
Binary file not shown.
Binary file added dmg/background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Load the read/writeable dmg with manually set Finder settings.
cp ./dmg/Paddle-Battle-rw.dmg ./builddir/Paddle-Battle-rw-tmp.dmg
# Resize the .dmg to fit the app (plus a 50MB buffer for leeway):
hdiutil resize -size "$(julia -E "M=1; $(du -hs builddir/Paddle\ Battle.app | awk '{print $1}') + 50")m" ./builddir/Paddle-Battle-rw-tmp.dmg
hdiutil attach ./builddir/Paddle-Battle-rw-tmp.dmg

# Replace the existing .app so that the position/size of the icon in Finder is preserved.
stat /Volumes/Paddle\ Battle/Paddle\ Battle.app || exit 1
rm -rf /Volumes/Paddle\ Battle/Paddle\ Battle.app # Remove current contents of app (in case you've removed/renamed files)
cp -r ./builddir/Paddle\ Battle.app /Volumes/Paddle\ Battle/ # Replace .app with new contents

hdiutil detach $(hdiutil info | grep '/Volumes/Paddle Battle' | awk '{print $1}')

# "Save" the modified r/w .dmg to a read-only, compressed .dmg
hdiutil convert -format UDZO -o ./builddir/Paddle-Battle-rw-converted.out.dmg ./builddir/Paddle-Battle-rw-tmp.dmg
mv ./builddir/Paddle-Battle-rw-converted.out.dmg ./builddir/Paddle-Battle.dmg

# Sign it
cp builddir/Paddle-Battle.dmg builddir/Paddle-Battle-unsigned.dmg
codesign -s "Developer ID Application: nhdalyMadeThis, LLC" builddir/Paddle-Battle.dmg


0 comments on commit f2c3379

Please sign in to comment.