forked from optimizely/react-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
43 lines (39 loc) · 1.53 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
language: generic
os: linux
stages:
- 'Lint markdown files'
- 'Test'
- 'Publish'
jobs:
include:
- stage: 'Lint markdown files'
os: linux
language: generic
install: gem install awesome_bot
before_script: skip
script:
- find . -type f -name '*.md' -exec awesome_bot {} \;
- stage: 'Test'
os: linux
language: node_js
node_js: 10
install: yarn
script: yarn test
addons:
srcclr: true
- stage: 'Publish'
if: type = push AND tag IS present AND tag =~ /^[0-9]+\.[0-9]+\.[0-9]+/
name: publish to github release
os: linux
language: minimal
install:
# installs hub to /tmp/bin
- 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')
- curl -fsSL "$URL" | tar xz -C /tmp --strip-components=1 --wildcards '*/bin/hub'
- export PATH=/tmp/bin:$PATH
- hub version
script:
- NEW_VERSION=$(grep -P '^## \[\d+\.\d+\.\d+.*\]' CHANGELOG.md | awk 'NR==1' | sed -e 's/\[/\\\[/' | sed -e 's/\]/\\\]/')
- LAST_VERSION=$(grep -P '^## \[\d+\.\d+\.\d+.*\]' CHANGELOG.md | awk 'NR==2' | sed -e 's/\[/\\\[/' | sed -e 's/\]/\\\]/')
- DESCRIPTION=$(awk "/^${NEW_VERSION}$/,/^${LAST_VERSION:-nothingmatched}$/" CHANGELOG.md | grep -v "^${LAST_VERSION:-nothingmatched}$")
- hub release create -m "Release ${TRAVIS_TAG}" -m "${DESCRIPTION}" "${TRAVIS_TAG}"