Skip to content

Commit

Permalink
Publish to NPM
Browse files Browse the repository at this point in the history
Authenticate with NPM via .npmrc and publish the package version + "-[git sha]".

Remove vm and vm.min.js, they'll be built before the package is published to NPM and available on installation. When installing from git, the build step will run on npm install.
  • Loading branch information
Ray Schamp committed Sep 26, 2016
1 parent 89f751e commit 7eb2e58
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 17,209 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -9,3 +9,5 @@ npm-*
/.nyc_output
/coverage
/dist.js
/vm.js
/vm.min.js
2 changes: 2 additions & 0 deletions .npmignore
@@ -0,0 +1,2 @@
/.nyc_output
/coverage
4 changes: 3 additions & 1 deletion .travis.yml
Expand Up @@ -17,7 +17,9 @@ after_script:
$RELEASE_BRANCHES =~ $TRAVIS_BRANCH &&
$TRAVIS_PULL_REQUEST = "false"
]]; then
./node_modules/.bin/gh-pages -x -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git -d playground -m "Travis build ${TRAVIS_BUILD_NUMBER}"
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
npm --no-git-tag-version version $(node -p -e "require('./package.json').version")-${TRAVIS_COMMIT:0:5}
npm publish
git config --global user.email $(git log --pretty=format:"%ce" -n1)
git config --global user.name $(git log --pretty=format:"%cn" -n1)
./node_modules/.bin/gh-pages -x -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git -d playground -m "Build for $(git log --pretty=format:%H)"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -11,7 +11,7 @@
},
"main": "./dist.js",
"scripts": {
"postinstall": "./node_modules/.bin/webpack",
"prepublish": "./node_modules/.bin/webpack --bail",
"start": "webpack-dev-server --host 0.0.0.0 --content-base .",
"test": "make test"
},
Expand Down

0 comments on commit 7eb2e58

Please sign in to comment.