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:
- dist
target_paths:
- content/build/${TRAVIS_BRANCH}
- content/leaflet/${NAME}
env:
global:
- ARTIFACTS_BUCKET=leafletjs-cdn
@ -19,5 +19,23 @@ env:
XW1hzORAtSpTgTKkQwel5gRMDy6SotzeSRsVV2jQCn46VIMx8G/J5nOI+ImL
yeoH12PhCR0h39dM7mq8TYJo5DHwvbotI5nQhpMruSt8eMFbym8nGiqQh806
fSJXkxmQ4MAjUdNFDIirBHhdZme8q3PueFzJ+5odFMvPGn/aITQ=
after_success: >
cd dist && zip -x .DS_Store -r leaflet.zip .
after_success:
- 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
#make sure deps are up to date
rm -r node_modules
npm install
# get current version
VERSION=$(node --eval "console.log(require('./package.json').version);")
# 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
copyfiles -u 1 build/*.json ./
# # create build, zip, bower and component artifacts
npm run build
cd dist && zip -x .DS_Store -r leaflet.zip . && cd ..
# cp build/*.json ./
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",
"scripts": {
"test": "jake test",
"prepublish": "jake build",
"publish": "./build/publish.sh"
"build": "jake build",
"release": "./build/publish.sh"
},
"repository": {
"type": "git",