Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ language: ruby
before_install:
- gem install bundler
- bundle install
after_success:
- script/tag_on_master
script: bundle exec rake book:build
deploy:
provider: releases
Expand Down
18 changes: 18 additions & 0 deletions script/tag_on_master
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# This is for running on Travis. It automatically tags any merge to Master as a release in the 2.1.x series.
if [[ $TRAVIS_PULL_REQUEST != 'false' || "$TRAVIS_BRANCH" != 'master' ]]; then
# Don't run on pull requests
echo 'This only runs on a merge to master.'
exit 0
fi

# Compute the next tag number
LASTPATCH=$(git describe --tags | cut -d- -f1 | cut -d. -f3)
PATCH=$(($LASTPATCH+1))
echo $PATCH

# Create a tag
curl -H "Authorization: token ${api-key}" \
-X "{\"ref\": \"refs/tags/2.1.$PATCH\", \"sha\": \"$TRAVIS_COMMIT\"}" \
https://api.github.com/repos/progit/progit2/git/refs