mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 06:23:37 -05:00
7eb2e58a38
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.
26 lines
854 B
YAML
26 lines
854 B
YAML
language: node_js
|
|
node_js:
|
|
- "4"
|
|
- "stable"
|
|
sudo: false
|
|
cache:
|
|
directories:
|
|
- node_modules
|
|
after_script:
|
|
- |
|
|
# RELEASE_BRANCHES and NPM_TOKEN defined in Travis settings panel
|
|
declare exitCode
|
|
$(npm bin)/travis-after-all
|
|
exitCode=$?
|
|
if [[
|
|
$exitCode = 0 &&
|
|
$RELEASE_BRANCHES =~ $TRAVIS_BRANCH &&
|
|
$TRAVIS_PULL_REQUEST = "false"
|
|
]]; then
|
|
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)"
|
|
fi
|