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
44stages :
55 - ' Lint markdown files'
66 - ' Test'
7+ - ' Publish'
78
89jobs :
910 include :
3031 - stage : ' Test'
3132 os : linux
3233 language : node_js
33- node_js :
34- - 10
34+ node_js : 10
3535 install : yarn
3636 script : yarn test
3737 addons :
3838 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