-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
31 lines (24 loc) · 990 Bytes
/
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
VERSION_FILE=.version
VERSION_STRING=$(shell cat "$(VERSION_FILE)")
.PHONY: get-version set-version git-tag lint publish
get-version:
@echo $(VERSION_STRING)
set-version:
$(eval NEW_VERSION := $(filter-out $@,$(MAKECMDGOALS)))
@echo "$(NEW_VERSION)" > "$(VERSION_FILE)"
@sed -i '' '/^[[:blank:]]*s.version/ s/'\"'[^'\"'][^'\"']*'\"'/'\"'$(NEW_VERSION)'\"'/' IRLSize.podspec
$(eval CHANGELOG_URL := "\#\# \[$(NEW_VERSION)\]\(https:\/\/github.com\/Detroit-Labs\/IRLSize\/releases\/tag\/$(NEW_VERSION)\)")
$(eval CHANGELOG_DATE := "\*\*Released:\*\* `date +"%Y-%m-%d"`")
@sed -i '' '3s/^/'$(CHANGELOG_URL)'\n'$(CHANGELOG_DATE)'\n\n/' CHANGELOG.md
git-tag:
ifneq ($(strip $(shell git status --untracked-files=no --porcelain 2>/dev/null)),)
$(error git state is not clean)
endif
git tag -a "$(VERSION_STRING)" -m "$(VERSION_STRING)"
git push origin "$(VERSION_STRING)"
lint:
bundle exec pod spec lint IRLSize.podspec
publish:
bundle exec pod trunk push IRLSize.podspec
%:
@: