forked from HexFiend/HexFiend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dist.sh
executable file
·30 lines (26 loc) · 833 Bytes
/
dist.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
set -e
CODESIGN="${1}"
if [ -z "${CODESIGN}" ]; then
echo "Code signing identity is required."
exit 1
fi
BUILDDIR="$(pwd)/build"
SCHEME="Release + CodeSign"
CONFIG="Release+CodeSign"
xcodebuild clean -scheme "${SCHEME}" \
"BUILD_DIR=${BUILDDIR}"
xcodebuild build -scheme "${SCHEME}" \
"CODE_SIGN_IDENTITY=${CODESIGN}" \
"BUILD_DIR=${BUILDDIR}"
APPNAME="Hex Fiend"
APP="${BUILDDIR}/${CONFIG}/${APPNAME}.app"
VERSION="$(defaults read "${APP}/Contents/Info.plist" CFBundleShortVersionString)"
DMG="$(echo "${APPNAME} ${VERSION}.dmg" | tr " " "_")"
FOLDER="${APPNAME} ${VERSION}"
rm -rf "${FOLDER}"
mkdir -p "${FOLDER}"
cp -Rp "${APP}" "docs/ReleaseNotes.html" "License.txt" "${FOLDER}"
hdiutil create -fs "HFS+" -format UDBZ -srcfolder "${FOLDER}" -ov "${DMG}"
rm -rf "${FOLDER}"
codesign -s "${CODESIGN}" "${DMG}"