Skip to content

Commit 5a38d00

Browse files
committed
Added deploy step in Travis to push new version as tags
1 parent 035552a commit 5a38d00

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.travis.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,31 @@ before_script:
4545
- sudo chmod a+rw /dev/loop0
4646
- dd if=/dev/zero bs=512 count=2048 of=disk
4747
- losetup /dev/loop0 disk
48+
49+
deploy:
50+
# Let before_deploy take over
51+
provider: script
52+
script: 'true'
53+
on:
54+
branch: master
55+
56+
before_deploy:
57+
- cd $TRAVIS_BUILD_DIR
58+
# Update tag for version defined in lfs.h
59+
- LFS_VERSION=$(grep -ox '#define LFS_VERSION .*' lfs.h | cut -d ' ' -f3)
60+
- LFS_VERSION_MAJOR=$((0xffff & ($LFS_VERSION >> 16)))
61+
- LFS_VERSION_MINOR=$((0xffff & ($LFS_VERSION >> 0)))
62+
- LFS_VERSION="v$LFS_VERSION_MAJOR.$LFS_VERSION_MINOR"
63+
- |
64+
curl -u $GEKY_BOT -X POST \
65+
https://api.github.com/repos/$TRAVIS_REPO_SLUG/git/refs \
66+
-d @- <<< "{
67+
\"ref\": \"refs/tags/$LFS_VERSION\",
68+
\"sha\": \"$TRAVIS_COMMIT\"
69+
}"
70+
- |
71+
curl -f -u $GEKY_BOT -X PATCH \
72+
https://api.github.com/repos/$TRAVIS_REPO_SLUG/git/refs/tags/$LFS_VERSION \
73+
-d @- <<< "{
74+
\"sha\": \"$TRAVIS_COMMIT\"
75+
}"

0 commit comments

Comments
 (0)