Skip to content

Commit 00ea6fe

Browse files
committed
[chore] refactor and clean up build system.
* added .version and .branch to .gitignore... this allow us to to write files once with new version, and now, the branch which the version will be released. when it finishes to publish, remove both files. * execute tests before publish was missing. * publish assets were not removed.
1 parent 5aac4a4 commit 00ea6fe

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.version
2+
.branch
13
examples/**/*-bundle.js
24
node_modules/
35
.idea/

Diff for: Makefile

+16-10
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ NPM=$(shell which npm)
33
YARN=$(shell which yarn)
44
JQ=$(shell which jq)
55

6+
REMOTE="[email protected]:reactjs/react-modal"
7+
68
VERSION=$(shell jq ".version" package.json)
79

810
help: info
11+
@echo
12+
@echo "Current version: $(VERSION)"
913
@echo
1014
@echo "List of commands:"
1115
@echo
@@ -24,7 +28,6 @@ info:
2428
@echo npm version: `$(NPM) --version` "($(NPM))"
2529
@echo yarn version: `$(YARN) --version` "($(YARN))"
2630
@echo jq version: `$(JQ) --version` "($(JQ))"
27-
@echo react-modal version: $(VERSION)
2831

2932
deps: deps-project deps-docs
3033

@@ -59,30 +62,33 @@ build-docs:
5962
@rm -rf _book
6063
@gitbook build -g reactjs/react-modal
6164

62-
version:
65+
.version:
6366
@echo "[Updating react-modal version]"
6467
@sh ./scripts/version $(VERSION)
68+
@$(JQ) '.version' package.json | cut -d\" -f2 > .version
69+
70+
.branch:
71+
git branch | grep '^*' | awk '{ print $$2 }' > .branch
6572

6673
release-commit:
67-
@$(JQ) '.version' package.json | cut -d\" -f2 > .version
6874
git commit --allow-empty -m "Release v`cat .version`."
69-
@rm .version
7075
git add .
7176
git commit --amend -m "`git log -1 --format=%s`"
7277

7378
release-tag:
74-
@$(JQ) '.version' package.json | cut -d\" -f2 > .version
7579
git tag "v`cat .version`"
76-
@rm .version
7780

7881
publish-version: release-commit release-tag
7982
@echo "[Publishing]"
80-
@$(JQ) '.version' package.json | cut -d\" -f2 > .version
81-
git push [email protected]:reactjs/react-modal "`git branch | grep '^*' | awk '{ print $$2 }'`" "v`cat .version`"
83+
git push $(REMOTE) "`cat .branch`" "v`cat .version`"
8284
npm publish
83-
@rm .version
8485

85-
publish: version deps-project build publish-version publish-finished
86+
publish-finished:
87+
@rm -rf .version .branch
88+
89+
pre-publish: .branch .version deps-project tests-ci build
90+
91+
publish: pre-publish publish-version publish-finished
8692

8793
publish-docs: deps-docs build-docs
8894
@echo "[Publishing docs]"

0 commit comments

Comments
 (0)