diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 14 | ||||
-rw-r--r-- | scripts/release.sh | 40 |
3 files changed, 52 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore index e3424f5f6..ca7bf15fe 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ html/doc/*.html man/ doc/*/index.md ./npmrc +release/ @@ -108,18 +108,26 @@ version: link git add package.json &&\ git ci -m v$(shell npm -v) -publish: link +publish: link doc git tag -s -m v$(shell npm -v) v$(shell npm -v) &&\ git push origin --tags &&\ npm publish &&\ - make doc-publish + npm tag npm@$(shell npm -v) $(shell npm -v | awk -F. '{print $1 "." $2}') &&\ + make doc-publish &&\ + make zip-publish docpublish: doc-publish doc-publish: doc rsync -vazu --stats --no-implied-dirs --delete html/doc/ npmjs.org:/var/www/npmjs.org/public/doc rsync -vazu --stats --no-implied-dirs --delete html/api/ npmjs.org:/var/www/npmjs.org/public/api +zip-publish: release + scp release/*.zip npmjs.org:/var/www/npmjs.org/public/dist/ + +release: + @bash scripts/release.sh + sandwich: @[ $$(whoami) = "root" ] && (echo "ok"; echo "ham" > sandwich) || echo "make it yourself" -.PHONY: all latest install dev link doc clean uninstall test man doc-publish doc-clean docclean docpublish +.PHONY: all latest install dev link doc clean uninstall test man doc-publish doc-clean docclean docpublish release zip-publish diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100644 index 000000000..fa36376d2 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# script for creating a zip and tarball for inclusion in node + +unset CDPATH + +set -e + +rm -rf release *.tgz || true +mkdir release +npm pack --loglevel error >/dev/null +mv *.tgz release +cd release +tar xzf *.tgz + +# remove some unnecessary stuff. +rm -rf package/node_modules/*/{test,bench,example}* +rm -rf package/test/{disabled,output,bin,root}* + +mkdir node_modules +mv package node_modules/npm + +# make the zip for windows users +cp node_modules/npm/bin/*.cmd . +zipname=npm-$(npm -v).zip +zip -q -9 -r -X "$zipname" *.cmd node_modules + +# make the tar for node's deps +cd node_modules +tarname=npm-$(npm -v).tgz +tar czf "$tarname" npm + +cd .. +mv "node_modules/$tarname" . + +rm -rf *.cmd +rm -rf node_modules + +echo "release/$tarname" +echo "release/$zipname" |