forked from smarty/smartystreets-javascript-sdk-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (22 loc) · 751 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
#!/usr/bin/make -f
VERSION := $(shell tagit -p --dry-run)
VERSION_FILE1 := package.json
VERSION_FILE2 := package-lock.json
clean:
rm -rf dist/
test: clean node_modules
npm run test
node_modules:
npm install
publish: clean test version upload unversion
tagit -p
git push origin --tags
upload:
npm publish
version:
sed -i.bak -e 's/^ "version": "0\.0\.0",/ "version": "$(VERSION)",/g' "$(VERSION_FILE1)" && rm -f "$(VERSION_FILE1).bak"
sed -i.bak -e 's/^ "version": "0\.0\.0",/ "version": "$(VERSION)",/g' "$(VERSION_FILE2)" && rm -f "$(VERSION_FILE2).bak"
unversion:
git checkout "$(VERSION_FILE1)" "$(VERSION_FILE2)"
# node_modules is a real directory target
.PHONY: clean test publish upload version unversion