-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to create+sign .dmg release to version control
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
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|