-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
41 lines (31 loc) · 1.04 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
# Slightly adjusted from: https://github.com/yonaskolb/Mint/blob/master/Makefile (thanks @yonaskolb!)
EXECUTABLE_NAME = pouch
REPO = https://github.com/sunshinejr/Pouch
VERSION = 0.2.0
PREFIX = /usr/local
INSTALL_PATH = $(PREFIX)/bin/$(EXECUTABLE_NAME)
BUILD_PATH = .build/release/$(EXECUTABLE_NAME)
CURRENT_PATH = $(PWD)
RELEASE_TAR = $(REPO)/archive/$(VERSION).tar.gz
CURRENT_DATE = $(shell date +%F)
.PHONY: install build uninstall publish release
install: build
mkdir -p $(PREFIX)/bin
cp -f $(BUILD_PATH) $(INSTALL_PATH)
build:
swift build --disable-sandbox -c release
uninstall:
rm -f $(INSTALL_PATH)
publish: zip_binary bump_brew
echo "Published $(VERSION)"
bump_brew:
brew update
brew bump-formula-pr --url=$(RELEASE_TAR) Pouch
zip_binary: build
zip -jr $(EXECUTABLE_NAME).zip $(BUILD_PATH)
release:
sed -i '' 's|\(version: "\)\(.*\)\("\)|\1$(VERSION)\3|' Sources/Pouch/Commands/Pouch.swift
sed -i '' 's/## Next/## Next\n\n## $(VERSION) ($(CURRENT_DATE))/g' Changelog.md
git add .
git commit -m "Releasing $(VERSION)"
git tag $(VERSION)