Skip to content

Commit

Permalink
Publish library on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
monkbroc committed Jun 20, 2017
1 parent 69210d9 commit 002f5fb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -3,9 +3,10 @@ node_js:
- 6
install:
- npm install -g particle-cli
- mkdir ~/.particle && echo '{"access_token": "$PARTICLE_TOKEN"}' > ~/.particle/particle.config.json
- 'mkdir ~/.particle && echo {\"access_token\": \"$PARTICLE_TOKEN\"} > ~/.particle/particle.config.json'
script:
- ./compile_examples.sh
- ./publish_library.sh
env:
# PARTICLE_TOKEN
- secure: "4i01XfTTn/1wzPw+AJR9Ap5GEePxajRYI08nCv0GWBU01m66192pim0tERYQM8Mo79VklK/4RXxGl0ieDi5eZtu28DwKHOgJ5rN2TUjqVhFYxsspRJ0OEtmKbsghR79s/Y4JBGUOwn5aE3wbQZL10MdF/z7n2cmrg06oVLoGxxlil50gnTt+cFbdzQuCIkiXKawkJG9UOePaPv1sYYa4HwR72AC+7H4+FNVCNGSJZockyN+EiwICXjrat5CLQBuRznf2gzV0XvGNOKt658GHEyyU+9fGqE8ttO6TOXZFt8TF9/dz3O4KULti874rkGUIq5IsQyEXFR7/PWyRRd033x2nn/aSjxxRTx2IhBGGi4ryhiBnb+nBLfu4cT3onrzVf1WKlyIMUX8oiwsuDp4h9dzaTUgvoeCH9sC8Nzloy1Sd1CL4yj6llqfU6QusrdKknyE8G/r02dHY6/URtKasRcYnxe/cu6h5tYp0OwWX/3XyTy0DeCJgGkv67VPLP8SitiZ+nML0QLhUqHUj3h5k07Sp+nSyp7Sd3bSRzGcmbk9TVOUFUEp6y46f8qp7W/l7VstDKiV+lDLEvbzw80QpWN82rCq+lqTXDlNlApRmYcL+cdDow2rcJvbCZqYmKGsRAET8Cu5lXwoh4XbPujY65fSuyW+Oy3GU93UMrFIGwNU="
2 changes: 1 addition & 1 deletion compile_examples.sh
Expand Up @@ -2,7 +2,7 @@
# Compile each library example as a test

set -xe
cd `dirname $0`

PLATFORMS="photon electron"
EXAMPLES=`ls examples`

Expand Down
11 changes: 11 additions & 0 deletions public_library.sh
@@ -0,0 +1,11 @@
#!/bin/bash
# Publish a new Particle library version when a tagged build passes

# Nothing to do if no tag
[ -z $TRAVIS_TAG ] && exit

# Check if the tag matches the library version
[ grep -e "^version=$TRAVIS_TAG$" library.properties ] && echo "libraries.properties is not at version $TRAVIS_TAG" && exit 1

# Publish
particle --no-update-check library publish

0 comments on commit 002f5fb

Please sign in to comment.