File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ language: ruby
2
2
before_install :
3
3
- gem install bundler
4
4
- bundle install
5
+ after_success :
6
+ - script/tag_on_master
5
7
script : bundle exec rake book:build
6
8
deploy :
7
9
provider : releases
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # This is for running on Travis. It automatically tags any merge to Master as a release in the 2.1.x series.
4
+ if [[ $TRAVIS_PULL_REQUEST != ' false' || " $TRAVIS_BRANCH " != ' master' ]]; then
5
+ # Don't run on pull requests
6
+ echo ' This only runs on a merge to master.'
7
+ exit 0
8
+ fi
9
+
10
+ # Compute the next tag number
11
+ LASTPATCH=$( git describe --tags | cut -d- -f1 | cut -d. -f3)
12
+ PATCH=$(( $LASTPATCH + 1 ))
13
+ echo $PATCH
14
+
15
+ # Create a tag
16
+ curl -H " Authorization: token ${api-key} " \
17
+ -X " {\" ref\" : \" refs/tags/2.1.$PATCH \" , \" sha\" : \" $TRAVIS_COMMIT \" }" \
18
+ https://api.github.com/repos/progit/progit2/git/refs
You can’t perform that action at this time.
0 commit comments