-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
63 lines (48 loc) · 1.67 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
55
56
57
58
59
60
61
62
VERSION_DEFAULT = dev
GITHUB_DOMAIN_DEFAULT = github.com
MERGIFY_DOMAIN_DEFAULT = dashboard.mergify.com
BROWSER_INSTALLATION_TEMPLATE = unknown-browser
VERSION ?= $(VERSION_DEFAULT)
GITHUB_DOMAIN ?= $(GITHUB_DOMAIN_DEFAULT)
MERGIFY_DOMAIN ?= $(MERGIFY_DOMAIN_DEFAULT)
TARGETS = mergify-firefox-$(VERSION).zip mergify-chrome-$(VERSION).zip mergify-safari-$(VERSION).zip
all: $(TARGETS)
@ls -la $(TARGETS)
firefox:
chrome:
safari:
safariTMP:
mergify-%-${VERSION}.zip: %
@echo "* Building $@..."
rm -rf build $@
cp -a src build
rm -rf build/__tests__
sed -i \
-e 's/#VERSION#/$(VERSION)/g' \
-e 's/$(GITHUB_DOMAIN_DEFAULT)/$(GITHUB_DOMAIN)/g' \
-e 's/$(MERGIFY_DOMAIN_DEFAULT)/$(MERGIFY_DOMAIN)/g' \
-e "s/$(BROWSER_INSTALLATION_TEMPLATE)/$</g" \
build/mergify.js build/manifest.json build/sendInstallState.js
cd build ; zip ../$@ *
rm -rf build
@echo
mergify-safari-${VERSION}.zip: mergify-safariTMP-$(VERSION).zip
rm -rf safari
mkdir -p safari/src
(cd safari/src && unzip ../../$<)
xcrun /Applications/Xcode.app/Contents/Developer/usr/bin/safari-web-extension-converter \
--macos-only \
--project-location safari \
--force \
--no-open \
--no-prompt \
--app-name mergify \
safari/src
(cd safari/mergify && \
xcodebuild -scheme mergify -configuration Release && \
xcodebuild -scheme mergify -archivePath ./build/mergify-safari-${VERSION}.xcarchive archive)
# TODO(sileht): sign the package
# xcodebuild -exportArchive -archivePath ./build/mergify-safari-${VERSION}.xcarchive -exportPath ./build -exportOptionsPlist ../../ExportOptions.plist
cd safari/mergify/build/mergify-safari-${VERSION}.xcarchive ; zip ../../../../$@ *
rm -rf safari $<
@echo