forked from coddingtonbear/taskwarrior-pomodoro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
createArchive.sh
executable file
·24 lines (18 loc) · 1007 Bytes
/
createArchive.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
appName='Taskwarrior Pomodoro'
archivesFolder='~/Library/Developer/Xcode/Archives'
todayArchives="$archivesFolder/$(date +%Y-%m-%d)"
appArchivePath="$todayArchives/$appName $(date +%Y-%m-%d,\ %H.%M).xcarchive"
packageName="taskwarrior-pomodoro"
tempPackagePath="builds/distribute/$packageName.dmg"
version=$(defaults read "$PWD/Taskwarrior Pomodoro/Info.plist" CFBundleShortVersionString)
xcodebuild -scheme "$appName" -archivePath "$appArchivePath" archive
xcrun xcodebuild -exportArchive -exportOptionsPlist exportOptions.plist -archivePath "$appArchivePath" -exportPath "builds/distribute"
spctl -a -v "builds/distribute/$appName.app"
echo ""
hdiutil create -size 14m -fs HFS+ -volname "$appName" $tempPackagePath
hdiutil attach $tempPackagePath
ln -s /Applications "/Volumes/$appName/"
cp -rf "builds/distribute/$appName.app" "/Volumes/$appName/"
hdiutil detach "/Volumes/$appName"
hdiutil convert $tempPackagePath -format UDZO -o "builds/distribute/$packageName-$version.dmg"
rm $tempPackagePath