new Travis configuration with automatic releases

This commit is contained in:
Vladimir Agafonkin 2015-10-14 17:56:50 +03:00
parent 80960fe9e7
commit 213c602f4e
3 changed files with 29 additions and 31 deletions

View File

@ -6,7 +6,7 @@ addons:
paths: paths:
- dist - dist
target_paths: target_paths:
- content/build/${TRAVIS_BRANCH} - content/leaflet/${NAME}
env: env:
global: global:
- ARTIFACTS_BUCKET=leafletjs-cdn - ARTIFACTS_BUCKET=leafletjs-cdn
@ -19,5 +19,23 @@ env:
XW1hzORAtSpTgTKkQwel5gRMDy6SotzeSRsVV2jQCn46VIMx8G/J5nOI+ImL XW1hzORAtSpTgTKkQwel5gRMDy6SotzeSRsVV2jQCn46VIMx8G/J5nOI+ImL
yeoH12PhCR0h39dM7mq8TYJo5DHwvbotI5nQhpMruSt8eMFbym8nGiqQh806 yeoH12PhCR0h39dM7mq8TYJo5DHwvbotI5nQhpMruSt8eMFbym8nGiqQh806
fSJXkxmQ4MAjUdNFDIirBHhdZme8q3PueFzJ+5odFMvPGn/aITQ= fSJXkxmQ4MAjUdNFDIirBHhdZme8q3PueFzJ+5odFMvPGn/aITQ=
after_success: > after_success:
cd dist && zip -x .DS_Store -r leaflet.zip . - npm run release
- NAME=$TRAVIS_BRANCH
- "[[ $TRAVIS_PULL_REQUEST != 'false' ]] && NAME=$TRAVIS_PULL_REQUEST"
- "[[ -n $TRAVIS_TAG ]] && NAME=$TRAVIS_TAG"
deploy:
provider: releases
api_key:
secure: JrqxB0Ed8TO2Aoy3Rcp7JS3O799b7qDKEYvdekEgCVmUyRa9Gd4/cSpDbUdlTSnlBS42pqIImar9V5tTT1A6ygcDZBKJnAdfUGCNxz5JDiVqd8HwHbqA2/m/jEUt34+i5yzVLZo4RR7Zvyiq0wPSBBvP9EvphBhrx6vHlb0M2Vg=
file:
- "dist/leaflet.js"
- "dist/leaflet-src.js"
- "bower.json"
- "component.json"
skip_cleanup: true
on:
tags: true
repo: Leaflet/Leaflet
after_deploy:
- npm publish

View File

@ -1,31 +1,11 @@
#!/bin/bash #!/bin/bash
#make sure deps are up to date VERSION=$(node --eval "console.log(require('./package.json').version);")
rm -r node_modules
npm install
# get current version # # create build, zip, bower and component artifacts
VERSION=$(node --eval "console.log(require('./package.json').version);") npm run build
# Build
git checkout -b build
npm test || exit 1
npm run prepublish
git add dist/leaflet-src.js dist/leaflet.js -f
# create the bower and component files cd dist && zip -x .DS_Store -r leaflet.zip . && cd ..
copyfiles -u 1 build/*.json ./
# cp build/*.json ./
tin -v $VERSION tin -v $VERSION
git add component.json bower.json -f
git commit -m "build $VERSION"
# Tag and push
echo git tag $VERSION
# git push --tags git@github.com:leaflet/leaflet.git $VERSION
# # # Publish JS modules
# npm publish
# # # Cleanup
# git checkout master
# git branch -D build

View File

@ -25,8 +25,8 @@
"style": "dist/leaflet.css", "style": "dist/leaflet.css",
"scripts": { "scripts": {
"test": "jake test", "test": "jake test",
"prepublish": "jake build", "build": "jake build",
"publish": "./build/publish.sh" "release": "./build/publish.sh"
}, },
"repository": { "repository": {
"type": "git", "type": "git",