-
-
Save jiming/9245755 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WORKSPACE = Artsy.xcworkspace | |
SCHEME = Artsy | |
CONFIGURATION = Beta | |
APP_PLIST = Artsy/App/Art.sy-Info.plist | |
BUNDLE_ID = net.artsy.artsy.beta | |
PLIST_BUDDY = /usr/libexec/PlistBuddy | |
BUNDLE_VERSION = $(shell $(PLIST_BUDDY) -c "Print CFBundleVersion" $(APP_PLIST)) | |
GIT_COMMIT = $(shell git log -n1 --format='%h') | |
ALPHA_VERSION = $(BUNDLE_VERSION)-$(BUILD_NUMBER)-$(GIT_COMMIT) | |
DATE = $(shell date "+%e %h") | |
CHANGELOG = CHANGELOG.md | |
CHANGELOG_SHORT = CHANGELOG_SHORT.md | |
IPA = Artsy.ipa | |
DSYM = Artsy.app.dSYM.zip | |
.PHONY: all build ci clean pods test | |
all: ci | |
build: | |
xctool -workspace $(WORKSPACE) -scheme $(SCHEME) -configuration $(CONFIGURATION) build | |
clean: | |
xctool -workspace $(WORKSPACE) -scheme $(SCHEME) -configuration $(CONFIGURATION) clean | |
test: | |
xctool -workspace $(WORKSPACE) -scheme $(SCHEME) -configuration Debug test -sdk iphonesimulator | |
ci: CONFIGURATION = Debug | |
ci: pods clean test fui | |
pr: CONFIGURATION = Debug | |
pr: pod clean test fui | |
pods: | |
gem install bundler | |
bundle install | |
rm -rf Pods | |
pod install | |
pod: | |
pod update | |
ipa: | |
$(PLIST_BUDDY) -c "Set CFBundleIdentifier $(BUNDLE_ID)" $(APP_PLIST) | |
$(PLIST_BUDDY) -c "Set CFBundleDisplayName $(BUNDLE_NAME)" $(APP_PLIST) | |
ipa build --scheme $(SCHEME) --configuration $(CONFIGURATION) -t | |
alpha_version: | |
$(PLIST_BUDDY) -c "Set CFBundleVersion $(ALPHA_VERSION)" $(APP_PLIST) | |
config/stamp Artsy/Resources/ImageAssets/AppIcon_80.png Artsy/Resources/ImageAssets/AppIcon_80.png "$(DATE)" | |
changelog: | |
changelog | |
distribute: | |
cat $(CHANGELOG) | head -n 50 | awk '{ print } END { print "..." }' > $(CHANGELOG_SHORT) | |
curl \ | |
-F status=2 \ | |
-F notify=$(NOTIFY) \ | |
-F "notes=<$(CHANGELOG_SHORT)" \ | |
-F notes_type=1 \ | |
-F ipa=@$(IPA) \ | |
-F dsym=@$(DSYM) \ | |
-H 'X-HockeyAppToken: $(HOCKEYAPP_TOKEN)' \ | |
https://rink.hockeyapp.net/api/2/apps/upload \ | |
| grep -v "errors" | |
deploy: pods ipa distribute | |
alpha: BUNDLE_NAME = 'Artsy α' | |
alpha: HOCKEYAPP_TOKEN = xxx | |
alpha: NOTIFY = 0 | |
alpha: alpha_version deploy | |
beta: BUNDLE_NAME = 'Artsy β' | |
beta: HOCKEYAPP_TOKEN = yyy | |
beta: NOTIFY = 1 | |
beta: deploy | |
fui: | |
bundle exec fui --path Artsy find |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment