This repository has been archived by the owner on Sep 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Makefile
61 lines (48 loc) · 1.77 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
ARCHIVE = "Alcatraz.tar.gz"
BUNDLE_NAME = "Alcatraz.xcplugin"
INSTALL_PATH = ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/${BUNDLE_NAME}/
TEST_BUILD_ARGS = -workspace TestProject/TestProject.xcworkspace -scheme TestProject
XCODEBUILD = xcodebuild $(TEST_BUILD_ARGS)
VERSION = $(shell /usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" Alcatraz/Alcatraz-Info.plist)
default: test
ci: clean ci_test
shipit: build update_install_url tag push_master_and_tags github_release push_deploy_branch
@echo "\nVersion $(VERSION) successfully released!"
clean:
$(XCODEBUILD) clean | xcpretty -c
rm -rf build
# Run tests
ci_test:
set -o pipefail && $(XCODEBUILD) test | xcpretty -c
test:
set -o pipefail && $(XCODEBUILD) test | tee xcodebuild.log | xcpretty -tc
# Merge changes into deploy branch
push_deploy_branch:
git fetch origin
ifeq ($(shell git diff origin/master..master),)
git checkout deploy
git reset --hard origin/master
git push origin deploy
git checkout -
else
$(error you have unpushed commits on the master branch)
endif
# Build archive ready for distribution
build: clean
rm -rf ${BUNDLE_NAME}
xcodebuild -project Alcatraz.xcodeproj build | tee xcodebuild.log | xcpretty -c
cp -r ${INSTALL_PATH} ${BUNDLE_NAME}
mkdir -p releases/${VERSION}
tar -czf releases/${VERSION}/${ARCHIVE} ${BUNDLE_NAME}
push_master_and_tags:
git push origin master
git push --tags
# Create a Github release
github_release:
hub release create -m "Release ${VERSION}" ${VERSION} -a "releases/${VERSION}"
# Commit & tag the version from ATZVersion.h
tag:
git tag $(VERSION)
update_install_url:
sed -i '' -Ee 's/[0-9]+(\.[0-9]+){2}/${VERSION}/' Scripts/install.sh
git commit -am "updated install script for version $(VERSION)"