@@ -3,8 +3,11 @@ BUILD_DIR = .build/release
33APP_BUNDLE = $(APP_NAME ) .app
44APP_CONTENTS = $(APP_BUNDLE ) /Contents
55INSTALL_PATH = /Applications/$(APP_BUNDLE )
6+ VERSION := $(shell cat VERSION)
7+ ARCHIVE = spacemap-$(VERSION ) .zip
8+ STAGE = spacemap-stage-$(VERSION )
69
7- .PHONY : build app install run dev uninstall clean config distconfig permissions
10+ .PHONY : build app install run dev uninstall clean config distconfig permissions archive
811
912build :
1013 swift build -c release
@@ -15,6 +18,23 @@ app: build
1518 cp $(BUILD_DIR ) /$(APP_NAME ) $(APP_CONTENTS ) /MacOS/
1619 cp Sources/spacemap/Info.plist $(APP_CONTENTS ) /
1720
21+ archive : app
22+ rm -rf $(STAGE ) $(ARCHIVE )
23+ mkdir -p $(STAGE )
24+ cp -R $(APP_BUNDLE ) $(STAGE ) /
25+ codesign --force --deep --sign - $(STAGE ) /$(APP_BUNDLE )
26+ cd $(STAGE ) && zip -r --symlinks ../$(ARCHIVE ) .
27+ rm -rf $(STAGE )
28+ @echo " "
29+ @echo " Artifact: $( ARCHIVE) "
30+ @echo " SHA-256: $$ (shasum -a 256 $( ARCHIVE) | awk '{print $$ 1}')"
31+ @echo " "
32+ @echo " Next: go to https://github.com/jsheffie/spacemap/releases/new"
33+ @echo " 1. Tag: v$( VERSION) "
34+ @echo " 2. Click 'Generate release notes'"
35+ @echo " 3. Attach $( ARCHIVE) "
36+ @echo " 4. Copy the SHA-256 above into Formula/spacemap.rb in homebrew-tap"
37+
1838install : app
1939 mkdir -p $(INSTALL_PATH ) /Contents/MacOS
2040 mkdir -p $(INSTALL_PATH ) /Contents/Resources
0 commit comments