Skip to content

Commit a660e94

Browse files
committed
Update make file
1 parent b36627a commit a660e94

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
CustomSuggestionService.xcodeproj/xcuserdata/
2+
sparkle/

makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
GITHUB_URL := https://github.com/intitni/CustomSuggestionServiceForCopilotForXcode/
2+
ZIPNAME_BASE := Custom.Suggestion.Service.app
3+
4+
setup:
5+
echo "Setup."
6+
7+
# Usage: make appcast app=path/to/bundle.app tag=1.0.0 [channel=beta] [release=1]
8+
appcast:
9+
$(eval TMPDIR := ~/Library/Caches/CustomSuggestionServiceRelease/$(shell uuidgen))
10+
$(eval BUNDLENAME := $(shell basename "$(app)"))
11+
$(eval WORKDIR := $(shell dirname "$(app)"))
12+
$(eval ZIPNAME := $(ZIPNAME_BASE)$(if $(channel),.$(channel).$(if $(release),$(release),1)))
13+
$(eval RELEASENOTELINK := $(GITHUB_URL)releases/tag/$(tag))
14+
mkdir -p $(TMPDIR)
15+
cp appcast.xml $(TMPDIR)/appcast.xml
16+
cd $(WORKDIR) && ditto -c -k --sequesterRsrc --keepParent "$(BUNDLENAME)" "$(ZIPNAME).zip"
17+
cd $(WORKDIR) && cp "$(ZIPNAME).zip" $(TMPDIR)/
18+
touch $(TMPDIR)/$(ZIPNAME).html
19+
echo "<body></body>" > $(TMPDIR)/$(ZIPNAME).html
20+
-sparkle/bin/generate_appcast $(TMPDIR) --download-url-prefix "$(GITHUB_URL)releases/download/$(tag)/" --release-notes-url-prefix "$(RELEASENOTELINK)" $(if $(channel),--channel "$(channel)")
21+
mv -f $(TMPDIR)/appcast.xml .
22+
rm -rf $(TMPDIR)
23+
sed -i '' 's/$(ZIPNAME).html/$(tag)/g' appcast.xml
24+
25+
.PHONY: setup appcast

0 commit comments

Comments
 (0)