File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ os: linux
4
4
stages :
5
5
- ' Lint markdown files'
6
6
- ' Test'
7
+ - ' Publish'
7
8
8
9
jobs :
9
10
include :
30
31
- stage : ' Test'
31
32
os : linux
32
33
language : node_js
33
- node_js :
34
- - 10
34
+ node_js : 10
35
35
install : yarn
36
36
script : yarn test
37
37
addons :
38
38
srcclr : true
39
+
40
+ - stage : ' Publish'
41
+ if : type = push AND tag IS present AND tag =~ /^[0-9]+\.[0-9]+\.[0-9]+/
42
+ name : publish to github release
43
+ os : linux
44
+ language : minimal
45
+ install :
46
+ # installs hub to /tmp/bin
47
+ - URL=$(curl https://api.github.com/repos/github/hub/releases/latest 2>/dev/null | jq -r '.assets[] | select(.browser_download_url | contains("linux-amd64")) | .browser_download_url')
48
+ - curl -fsSL "$URL" | tar xz -C /tmp --strip-components=1 --wildcards '*/bin/hub'
49
+ - export PATH=/tmp/bin:$PATH
50
+ - hub version
51
+ script :
52
+ - NEW_VERSION=$(grep -P '^## \[\d+\.\d+\.\d+.*\]' CHANGELOG.md | awk 'NR==1' | sed -e 's/\[/\\\[/' | sed -e 's/\]/\\\]/')
53
+ - LAST_VERSION=$(grep -P '^## \[\d+\.\d+\.\d+.*\]' CHANGELOG.md | awk 'NR==2' | sed -e 's/\[/\\\[/' | sed -e 's/\]/\\\]/')
54
+ - DESCRIPTION=$(awk "/^${NEW_VERSION}$/,/^${LAST_VERSION:-nothingmatched}$/" CHANGELOG.md | grep -v "^${LAST_VERSION:-nothingmatched}$")
55
+ - hub release create -m "Release ${TRAVIS_TAG}" -m "${DESCRIPTION}" "${TRAVIS_TAG}"
You can’t perform that action at this time.
0 commit comments