Skip to content

Commit 292213f

Browse files
committed
Bump Cargo.toml version on tag
1 parent 576ed59 commit 292213f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ matrix:
88
- rust: nightly
99
fast_finish: true
1010

11+
after_success:
12+
- scripts/push_version.sh
13+
1114
before_deploy:
1215
- cargo build --release
1316
- mv target/release/{main,task_diff}

scripts/push_version.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash -ex
2+
3+
if [ -n "$TRAVIS_TAG" ];
4+
then
5+
sed -i "s/^version \{0,1\}=.*/version = \"${TRAVIS_TAG:1}\"/" Cargo.toml
6+
git config --local user.name "Travis CI"
7+
git config --local user.email "[email protected]"
8+
git add Cargo.toml
9+
git commit --allow-empty -m "Bump version to $TRAVIS_TAG [skip ci]"
10+
git push https://${GITHUB_TOKEN}@github.com/maur1th/task_diff.git HEAD:master
11+
fi

0 commit comments

Comments
 (0)