Skip to content

Commit

Permalink
[contrib/mac/app]: Add renotarization script for easier notarization …
Browse files Browse the repository at this point in the history
…of built DMGs
  • Loading branch information
staticfloat committed Feb 17, 2020
1 parent 6aa0d92 commit 8667f52
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions contrib/mac/app/renotarize_dmg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

# We need a URL
if [[ -z "$1" ]]; then
echo "Usage: $0 <julia DMG url>" >&2
exit 1
fi

# You need to define these in your environment
if [[ -z "${APPLEID}" ]] || [[ -z "${APPLEID_PASSWORD}" ]]; then
echo "You must define APPLEID and APPLEID_PASSWORD in your environment!" >&2
exit 1
fi

# Download .dmg
curl -L "$1" -O

# Unpack dmg into our `dmg` folder
rm -rf dmg

# Copy app over to our `dmg` folder
for j in /Volumes/Julia-*; do hdiutil detach "${j}"; done
hdiutil mount "$(basename "$1")"
cp -Ra /Volumes/Julia-* dmg

# Override some important Makefile variables
DMG_NAME=$(basename "$1")
APP_NAME=$(basename dmg/*.app)
VOL_NAME=$(basename /Volumes/Julia-*)
# Unmount everything again
for j in /Volumes/Julia-*; do hdiutil detach "${j}"; done

# Run notarization
make notarize "DMG_NAME=${DMG_NAME}" "APP_NAME=${APP_NAME}" "VOL_NAME=${VOL_NAME}"

0 comments on commit 8667f52

Please sign in to comment.