forked from reactjs/react-modal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore] improving build and publish pipeline.
- Loading branch information
Showing
10 changed files
with
124 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,7 @@ examples/**/*-bundle.js | |
node_modules/ | ||
.idea/ | ||
_book | ||
coverage/* | ||
*.patch | ||
*.diff | ||
examples/__build__ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ node_js: | |
before_script: | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
script: | ||
- make tests-ci |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
NODE=$(shell which node) | ||
NPM=$(shell which npm) | ||
YARN=$(shell which yarn) | ||
JQ=$(shell which jq) | ||
|
||
VERSION=$(shell jq ".version" package.json) | ||
|
||
help: info | ||
@echo | ||
@echo "List of commands:" | ||
@echo | ||
@echo " make info - display node, npm and yarn versions..." | ||
@echo " make deps - install all dependencies." | ||
@echo " make serve - start the server." | ||
@echo " make tests - run tests." | ||
@echo " make docs - build and serve the docs." | ||
@echo " make build - build project artifacts." | ||
@echo " make publish - build and publish version on npm." | ||
@echo " make publish-docs - build the docs and publish to gh-pages." | ||
@echo " make publish-all - publish version and docs." | ||
|
||
info: | ||
@echo node version: `$(NODE) --version` "($(NODE))" | ||
@echo npm version: `$(NPM) --version` "($(NPM))" | ||
@echo yarn version: `$(YARN) --version` "($(YARN))" | ||
@echo jq version: `$(JQ) --version` "($(JQ))" | ||
@echo react-modal version: $(VERSION) | ||
|
||
deps: | ||
@[[ ! -z "$(YARN)" ]] && $(YARN) install || $(NPM) install | ||
@gitbook install | ||
|
||
# Rules for development | ||
|
||
serve: | ||
@npm start | ||
|
||
tests: | ||
@npm run test | ||
|
||
tests-ci: | ||
@npm run test -- --single-run | ||
|
||
docs: build-docs | ||
gitbook serve | ||
|
||
# Rules for build and publish | ||
|
||
build: | ||
@echo "[Building dists]" | ||
@./node_modules/.bin/webpack --config webpack.dist.config.js | ||
|
||
build-docs: | ||
@echo "[Building documentation]" | ||
@rm -rf _book/* | ||
@gitbook build -g reactjs/react-modal | ||
|
||
version: | ||
@echo "[Updating react-modal version]" | ||
@sh ./scripts/version $(VERSION) | ||
|
||
release-commit: | ||
@$(JQ) '.version' package.json | cut -d\" -f2 > .version | ||
git commit --allow-empty -m "Release v`cat .version`." | ||
@rm .version | ||
git add . | ||
git commit --amend -m "`git log -1 --format=%s`" | ||
|
||
release-tag: | ||
@$(JQ) '.version' package.json | cut -d\" -f2 > .version | ||
git tag "v`cat .version`" | ||
@rm .version | ||
|
||
publish-version: release-commit release-tag | ||
@echo "[Publishing]" | ||
@$(JQ) '.version' package.json | cut -d\" -f2 > .version | ||
git push [email protected]:reactjs/react-modal "`git branch | grep '^*' | awk '{ print $$2 }'`" "v`cat .version`" | ||
npm publish | ||
@rm .version | ||
|
||
publish: version build publish-version publish-finished | ||
|
||
publish-docs: build-docs | ||
@echo "[Publishing docs]" | ||
cd _book | ||
git init | ||
git commit --allow-empty -m 'update book' | ||
git checkout -b gh-pages | ||
touch .nojekyll | ||
git add . | ||
git commit -am 'update book' | ||
git push [email protected]:reactjs/react-modal gh-pages --force | ||
cd .. | ||
|
||
publish-all: publish publish-docs |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,15 +13,8 @@ | |
"example": "examples" | ||
}, | ||
"scripts": { | ||
"test": "NODE_ENV=test karma start", | ||
"start": "scripts/dev-examples", | ||
"docs": "npm-run-all docs:*", | ||
"docs-dev": "npm-run-all docs:clean docs:prepare docs:build:watch", | ||
"docs:clean": "rimraf _book", | ||
"docs:prepare": "gitbook install", | ||
"docs:build": "gitbook build -g reactjs/react-modal", | ||
"docs:build:watch": "gitbook serve", | ||
"docs:publish": "cd _book && git init && git commit --allow-empty -m 'update book' && git checkout -b gh-pages && touch .nojekyll && git add . && git commit -am 'update book' && git push [email protected]:reactjs/react-modal gh-pages --force" | ||
"start": "./node_modules/.bin/webpack-dev-server --inline --host 127.0.0.1 --content-base examples/", | ||
"test": "NODE_ENV=test karma start" | ||
}, | ||
"authors": [ | ||
"Ryan Florence" | ||
|
@@ -77,4 +70,4 @@ | |
"modal", | ||
"dialog" | ||
] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
|
||
JQ=$(which jq) | ||
|
||
if [[ -z "$JQ" ]]; then | ||
echo "jq is missing." | ||
fi | ||
|
||
echo "Current version is: $1" | ||
|
||
read -p "Bump to: " NEW_VERSION | ||
|
||
FILES="package.json bower.json" | ||
|
||
for F in $FILES; do | ||
$JQ ".version = \"${NEW_VERSION}\"" "$F" > up.json | ||
cat up.json > "$F" | ||
done | ||
|
||
rm up.json |