forked from exelban/custer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
103 lines (77 loc) · 2.79 KB
/
Copy pathMakefile
File metadata and controls
103 lines (77 loc) · 2.79 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
APP = Custer
BUNDLE_ID = eu.exelban.$(APP)
BUILD_PATH = $(PWD)/build
APP_PATH = "$(BUILD_PATH)/$(APP).app"
ZIP_PATH = "$(BUILD_PATH)/$(APP).zip"
.SILENT: archive notarize sign prepare-dmg prepare-dSYM clean next-version check history
.PHONY: build archive notarize sign prepare-dmg prepare-dSYM clean next-version check history dep
build: clean next-version archive notarize sign prepare-dmg prepare-dSYM open
# --- MAIN WORLFLOW FUNCTIONS --- #
archive: next-version clean
echo "Starting archiving the project..."
xcodebuild \
-scheme $(APP) \
-destination 'platform=OS X,arch=x86_64' \
-configuration Release archive \
-archivePath $(BUILD_PATH)/$(APP).xcarchive
echo "Application built, starting the export archive..."
xcodebuild -exportArchive \
-exportOptionsPlist "$(PWD)/exportOptions.plist" \
-archivePath $(BUILD_PATH)/$(APP).xcarchive \
-exportPath $(BUILD_PATH)
ditto -c -k --keepParent $(APP_PATH) $(ZIP_PATH)
echo "Project archived successfully"
notarize:
echo "Starting notarizing the project..."
xcrun notarytool submit --keychain-profile "AC_PASSWORD" --wait $(ZIP_PATH)
echo "Stats successfully notarized"
sign:
echo "Going to staple an application..."
xcrun stapler staple $(APP_PATH)
spctl -a -t exec -vvv $(APP_PATH)
echo "Application successfully stapled"
prepare-dmg:
if [ ! -d $(PWD)/create-dmg ]; then \
git clone https://github.com/andreyvit/create-dmg; \
fi
./create-dmg/create-dmg \
--volname $(APP) \
--background "./Custer/Supporting Files/background.png" \
--window-pos 200 120 \
--window-size 500 320 \
--icon-size 80 \
--icon "Custer.app" 125 175 \
--hide-extension "Custer.app" \
--app-drop-link 375 175 \
$(PWD)/$(APP).dmg \
$(APP_PATH)
rm -rf ./create-dmg
prepare-dSYM:
echo "Zipping dSYMs..."
cd $(BUILD_PATH)/Custer.xcarchive/dSYMs && zip -r $(PWD)/dSYMs.zip .
echo "Created zip with dSYMs"
# --- HELPERS --- #
clean:
rm -rf $(BUILD_PATH)
if [ -a $(PWD)/dSYMs.zip ]; then rm $(PWD)/dSYMs.zip; fi;
if [ -a $(PWD)/Custer.dmg ]; then rm $(PWD)/Custer.dmg; fi;
next-version:
versionNumber=$$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$(PWD)/Custer/Supporting Files/Info.plist") ;\
echo "Actual version is: $$versionNumber" ;\
versionNumber=$$((versionNumber + 1)) ;\
echo "Next version is: $$versionNumber" ;\
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $$versionNumber" "$(PWD)/Custer/Supporting Files/Info.plist" ;\
check:
xcrun altool \
--notarization-info 9b7c4d1f-ae81-4571-9ab1-592289f9d57a \
-itc_provider $(AC_PROVIDER) \
-u $(AC_USERNAME) \
-p @keychain:AC_PASSWORD
history:
xcrun altool --notarization-history 0 \
-itc_provider $(AC_PROVIDER) \
-u $(AC_USERNAME) \
-p @keychain:AC_PASSWORD
open:
echo "Opening working folder..."
open $(PWD)