-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathMakefile
105 lines (84 loc) · 4.6 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
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
104
105
define n
endef
.EXPORT_ALL_VARIABLES:
BETA=
DELTAS=5
ifeq (, $(VERSION))
VERSION=$(shell rg -o --no-filename 'MARKETING_VERSION = ([^;]+).+' -r '$$1' *.xcodeproj/project.pbxproj | head -1 | sd 'b\d+' '')
endif
ifneq (, $(BETA))
FULL_VERSION:=$(VERSION)b$(BETA)
else
FULL_VERSION:=$(VERSION)
endif
RELEASE_NOTES_FILES := $(wildcard ReleaseNotes/*.md)
ENV=Release
DERIVED_DATA_DIR=$(shell ls -td $$HOME/Library/Developer/Xcode/DerivedData/Clop-* | head -1)
.PHONY: build upload release setversion appcast setapp bin
print-% : ; @echo $* = $($*)
build: SHELL=fish
build:
make-app --build --devid --dmg -s Clop -t Clop -c Release --version $(FULL_VERSION)
xcp /tmp/apps/Clop-$(FULL_VERSION).dmg Releases/
dmg: SHELL=fish
dmg:
make-app --dmg -s Clop -t Clop -c Release --version $(FULL_VERSION) /tmp/apps/Clop.app
xcp /tmp/apps/Clop-$(FULL_VERSION).dmg Releases/
upload:
rsync -avzP Releases/*.{delta,dmg} hetzner:/static/lowtechguys/releases/ || true
rsync -avz Releases/*.html hetzner:/static/lowtechguys/ReleaseNotes/
rsync -avzP Releases/appcast.xml hetzner:/static/lowtechguys/clop/
cfcli -d lowtechguys.com purge
$(MAKE) sentry
release:
gh release create v$(VERSION) -F ReleaseNotes/$(VERSION).md "Releases/Clop-$(VERSION).dmg#Clop.dmg"
setapp: SHELL=fish
setapp:
make-app --build --devid --notarize -s Setapp -t Clop-setapp -c Release --version $(FULL_VERSION)
$(MAKE) setapp-zip
setapp-zip: SHELL=fish
setapp-zip:
cp Clop/Assets.xcassets/AppIcon.appiconset/icon_512x512.png /tmp/apps/AppIcon.png
rm /tmp/apps/Clop-setapp.zip || true
cd /tmp/apps && zip --symlinks -r Clop-setapp.zip Clop.app AppIcon.png
sentry:
op run -- sentry-cli upload-dif --include-sources -o alin-panaitiu -p clop --wait -- $(DERIVED_DATA_DIR)/Build/Intermediates.noindex/ArchiveIntermediates/Clop/BuildProductsPath/Release/
sentry-setapp:
op run -- sentry-cli upload-dif --include-sources -o alin-panaitiu -p clop --wait -- $(DERIVED_DATA_DIR)/Build/Intermediates.noindex/ArchiveIntermediates/Setapp/BuildProductsPath/Release/
appcast: Releases/Clop-$(FULL_VERSION).html
rm Releases/Clop.dmg || true
ifneq (, $(BETA))
rm Releases/Clop$(FULL_VERSION)*.delta >/dev/null 2>/dev/null || true
generate_appcast --channel beta --maximum-versions 10 --maximum-deltas $(DELTAS) --link "https://lowtechguys.com/clop" --full-release-notes-url "https://github.com/FuzzyIdeas/Clop/releases" --release-notes-url-prefix https://files.lowtechguys.com/ReleaseNotes/ --download-url-prefix "https://files.lowtechguys.com/releases/" -o Releases/appcast.xml Releases
else
rm Releases/Clop$(FULL_VERSION)*.delta >/dev/null 2>/dev/null || true
rm Releases/Clop-*b*.dmg >/dev/null 2>/dev/null || true
rm Releases/Clop*b*.delta >/dev/null 2>/dev/null || true
generate_appcast --maximum-versions 10 --maximum-deltas $(DELTAS) --link "https://lowtechguys.com/clop" --full-release-notes-url "https://github.com/FuzzyIdeas/Clop/releases" --release-notes-url-prefix https://files.lowtechguys.com/ReleaseNotes/ --download-url-prefix "https://files.lowtechguys.com/releases/" -o Releases/appcast.xml Releases
cp Releases/Clop-$(FULL_VERSION).dmg Releases/Clop.dmg
endif
setversion: OLD_VERSION=$(shell rg -o --no-filename 'MARKETING_VERSION = ([^;]+).+' -r '$$1' *.xcodeproj/project.pbxproj | head -1)
setversion: SHELL=fish
setversion:
ifneq (, $(FULL_VERSION))
sdfk '((?:CURRENT_PROJECT|MARKETING)_VERSION) = $(OLD_VERSION);' '$$1 = $(FULL_VERSION);'
endif
Releases/Clop-%.html: ReleaseNotes/$(VERSION)*.md
@echo Compiling $^ to $@
ifneq (, $(BETA))
pandoc -f gfm -o $@ --standalone --metadata title="Clop $(FULL_VERSION) - Release Notes" --css https://files.lowtechguys.com/release.css $(shell ls -t ReleaseNotes/$(VERSION)*.md)
else
pandoc -f gfm -o $@ --standalone --metadata title="Clop $(FULL_VERSION) - Release Notes" --css https://files.lowtechguys.com/release.css ReleaseNotes/$(VERSION).md
endif
NOTARIZE=1
Clop/bin.tar.lrz: PATH=$(shell echo $$PWD:$$PATH)
Clop/bin.tar.lrz: $(wildcard Clop/bin/*) $(wildcard Clop/bin/*/*)
mkdir -p /tmp/tonotarize; rm /tmp/tonotarize.zip /tmp/tonotarize/* || true
fd -uu -t file . Clop/bin -x zsh -c 'codesign -v -R="anchor apple generic" "{}" || { codesign -fs "$$CODESIGN_CERT" --options runtime --entitlements Clop/bin.entitlements --timestamp "{}" && cp "{}" /tmp/tonotarize/$$(jot -r 1)_{/} ; }'
ifeq (1, $(NOTARIZE))
test $$(ls /tmp/tonotarize | wc -l) -gt 0 && zip -r /tmp/tonotarize.zip /tmp/tonotarize && \
xcrun notarytool submit --progress --wait --keychain-profile Alin /tmp/tonotarize.zip
endif
rm Clop/bin.tar.lrz; cd Clop/bin/; tar --lrzip -cf ../bin.tar.lrz *
sha256sum Clop/bin.tar.lrz | cut -d' ' -f1 > Clop/bin.tar.lrz.sha256
bin: Clop/bin.tar.lrz