Skip to content

Commit

Permalink
Bump Cargo.toml version on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
maur1th committed Jan 17, 2019
1 parent 576ed59 commit 292213f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ matrix:
- rust: nightly
fast_finish: true

after_success:
- scripts/push_version.sh

before_deploy:
- cargo build --release
- mv target/release/{main,task_diff}
Expand Down
11 changes: 11 additions & 0 deletions scripts/push_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash -ex

if [ -n "$TRAVIS_TAG" ];
then
sed -i "s/^version \{0,1\}=.*/version = \"${TRAVIS_TAG:1}\"/" Cargo.toml
git config --local user.name "Travis CI"
git config --local user.email "[email protected]"
git add Cargo.toml
git commit --allow-empty -m "Bump version to $TRAVIS_TAG [skip ci]"
git push https://${GITHUB_TOKEN}@github.com/maur1th/task_diff.git HEAD:master
fi

0 comments on commit 292213f

Please sign in to comment.