Skip to content

Instantly share code, notes, and snippets.

@dstnbrkr
Last active September 25, 2017 00:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dstnbrkr/7516573 to your computer and use it in GitHub Desktop.
Save dstnbrkr/7516573 to your computer and use it in GitHub Desktop.
The Makefile we use for continuous integration and distribution at Artsy.net
PROJECT = Artsy
BUNDLE_ID = net.artsy.artsy.beta
CONFIGURATION = Beta
WORKSPACE = $(PROJECT).xcworkspace
SCHEME = $(PROJECT)
APP_PLIST = $(PROJECT)/App/$(PROJECT)-Info.plist
IPA = $(PROJECT).ipa
DSYM = $(PROJECT).app.dSYM.zip
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)
CHANGELOG = CHANGELOG.md
CHANGELOG_SHORT = CHANGELOG_SHORT.md
xctool:
xctool -workspace $(WORKSPACE) -scheme $(SCHEME) -configuration $(CONFIGURATION) $(XCTOOL_COMMAND)
build: XCTOOL_COMMAND = build
build: xctool
clean: XCTOOL_COMMAND = clean
clean: xctool
ci: CONFIGURATION = Debug
ci: pods clean build
pods:
rvm 1.9.3-p194
gem install bundler
bundle install
pod install
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)
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 = "<alpha token>"
alpha: NOTIFY = 0
alpha: alpha_version deploy
beta: BUNDLE_NAME = 'Artsy β'
beta: HOCKEYAPP_TOKEN = "<beta token>"
beta: NOTIFY = 1
beta: deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment