Skip to content

Commit 8efa24d

Browse files
committed
Add appcast task to make file
1 parent 45c209e commit 8efa24d

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

Makefile

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1+
GITHUB_URL := https://github.com/intitni/CopilotForXcode/
2+
ZIPNAME_BASE := Copilot.for.Xcode.app
3+
14
setup:
25
echo "Setup."
36

4-
setup-langchain:
5-
echo "Don't setup LangChain!"
6-
cd Python; \
7-
curl -L https://github.com/beeware/Python-Apple-support/releases/download/3.11-b1/Python-3.11-macOS-support.b1.tar.gz -o Python-3.11-macOS-support.b1.tar.gz; \
8-
tar -xzvf Python-3.11-macOS-support.b1.tar.gz; \
9-
rm Python-3.11-macOS-support.b1.tar.gz; \
10-
cp module.modulemap.copy Python.xcframework/macos-arm64_x86_64/Headers/module.modulemap
11-
cd Python/site-packages; \
12-
sh ./install.sh
7+
# Usage: make appcast app=path/to/bundle.app tag=1.0.0 [channel=beta] [release=1]
8+
appcast:
9+
$(eval TMPDIR := ~/Library/Caches/CopilotForXcodeRelease/$(shell uuidgen))
10+
$(eval BUNDLENAME := $(shell basename "$(app)"))
11+
$(eval ZIPNAME := $(ZIPNAME_BASE).$(if $(channel),$(channel).)$(if $(release),$(release),1).zip)
12+
mkdir -p $(TMPDIR)
13+
cp appcast.xml $(TMPDIR)/appcast.xml
14+
cd "$(app)" && cd .. && zip -r "$(ZIPNAME)" "$(BUNDLENAME)"
15+
cd "$(app)" && cd .. && cp "$(ZIPNAME)" $(TMPDIR)/
16+
-Core/.build/artifacts/sparkle/bin/generate_appcast $(TMPDIR) --download-url-prefix "$(GITHUB_URL)releases/download/$(tag)/" --full-release-notes-url "$(GITHUB_URL)releases/tag/$(tag)" $(if $(channel),--channel "$(channel)")
17+
mv -f $(TMPDIR)/appcast.xml .
18+
rm -rf $(TMPDIR)
1319

14-
.PHONY: setup setup-langchain
20+
.PHONY: setup appcast

0 commit comments

Comments
 (0)