-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
54 lines (48 loc) · 2.31 KB
/
Makefile
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
TOP=$(shell pwd)
RELEASE_VERSION=1.9.0
RELEASE_DIR=$(TOP)/release-$(RELEASE_VERSION)
RELEASE_NAME=Monolingual-$(RELEASE_VERSION)
RELEASE_FILE=$(RELEASE_DIR)/$(RELEASE_NAME).dmg
RELEASE_ZIPFILE=$(RELEASE_NAME).zip
RELEASE_ZIP=$(RELEASE_DIR)/$(RELEASE_ZIPFILE)
SOURCE_DIR=$(TOP)
BUILD_DIR=$(TOP)/build
CODESIGN_IDENTITY='Developer ID Application: Ingmar Stein (ADVP2P7SJK)'
.PHONY: all release development deployment archive clean
all: deployment
development: clean
bundle exec fastlane debug
deployment: clean
bundle exec fastlane release
clean:
-rm -rf $(BUILD_DIR) $(RELEASE_DIR)
release: clean deployment
# Check code signature
codesign -vvv --deep --strict $(BUILD_DIR)/Monolingual.app
# Check SMJobBless code signing setup
./SMJobBlessUtil.py check $(BUILD_DIR)/Monolingual.app/Contents/XPCServices/Monolingual.xpc
# Check app against Gatekeeper system policies
spctl --assess --type execute -vv $(BUILD_DIR)/Monolingual.app
mkdir -p $(RELEASE_DIR)/build
cp -R $(BUILD_DIR)/Monolingual.app.dSYM.zip $(RELEASE_DIR)
cp -R $(BUILD_DIR)/Monolingual.app $(BUILD_DIR)/Monolingual.app/Contents/Resources/*.rtfd $(BUILD_DIR)/Monolingual.app/Contents/Resources/LICENSE.txt $(RELEASE_DIR)/build
mkdir -p $(RELEASE_DIR)/build/.dmg-resources
tiffutil -cathidpicheck $(SOURCE_DIR)/dmg-bg.png $(SOURCE_DIR)/[email protected] -out $(RELEASE_DIR)/build/.dmg-resources/dmg-bg.tiff
ln -s /Applications $(RELEASE_DIR)/build
./make-diskimage.sh $(BUILD_DIR)/Monolingual.dmg $(RELEASE_DIR)/build Monolingual $(CODESIGN_IDENTITY) dmg.js
# Notarize app and disk image
bundle exec fastlane notarize
xcrun stapler validate --verbose $(BUILD_DIR)/Monolingual.app
xcrun stapler validate --verbose $(BUILD_DIR)/Monolingual.dmg
# Verify DMG code signature
spctl --assess --type open --context context:primary-signature -vv $(BUILD_DIR)/Monolingual.dmg
# Verify notarization
codesign -vvvv -R="notarized" --check-notarization $(BUILD_DIR)/Monolingual.dmg
/usr/bin/ditto -c -k --keepParent $(BUILD_DIR)/Monolingual.app $(RELEASE_ZIP)
mv $(BUILD_DIR)/Monolingual.dmg $(RELEASE_FILE)
sed -e "s/%VERSION%/$(RELEASE_VERSION)/g" \
-e "s/%PUBDATE%/$$(LC_ALL=C date +"%a, %d %b %G %T %z")/g" \
-e "s/%FILENAME%/$(RELEASE_ZIPFILE)/g" \
-e "s@%SIGNATURE%@$$(./sign_update $(RELEASE_ZIP))@g" \
appcast.xml.tmpl > $(RELEASE_DIR)/appcast.xml
rm -rf $(RELEASE_DIR)/build