-
Notifications
You must be signed in to change notification settings - Fork 9
/
.travis.yml
73 lines (63 loc) · 2.41 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
language: go
node_js:
- 8
go:
- 1.12
os:
- osx
- linux
cache:
directories:
- "~/.npm"
- "~/.cache"
before_install: if [[ `npm -v` != 5.7* ]]; then npm i -g npm@5; fi
install:
- go get -v -u github.com/twinj/uuid
- go get -v -u github.com/kr/pty
- go get -v -u github.com/revel/cmd/revel
- go get -v -u github.com/golang/dep/cmd/dep
- go get -v -u github.com/swaggo/swag/cmd/swag
- go get -v -u github.com/revel/cmd
- npm ci
- dep ensure
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
sed -i '' "s/\/\/ @version 1.0.0/\/\/ @version $TRAVIS_TAG/" app/controllers/api_v1.go
else
sed -i "s/\/\/ @version 1.0.0/\/\/ @version $TRAVIS_TAG/g" app/controllers/api_v1.go
fi
- swag init -g api_v1.go -d app/controllers
before_script:
- revel version
- revel run github.com/anikitenko/mini-sftp-client &
- sleep 15
script:
- "$(npm bin)/cypress run --record"
- kill $(jobs -p) || true
- |
if [[ "$TRAVIS_OS_NAME" == "osx" && "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-.+)?$ ]]; then
echo "Will be releasing!"
export TO_DEPLOY=yes
fi
before_deploy:
- |
export BODY="Detailed release information can be found at [CHANGELOG.md $TRAVIS_TAG](https://github.com/anikitenko/mini-sftp-client/blob/master/CHANGELOG.md#$(echo $TRAVIS_TAG | sed -e 's/\.//g' | tr '[:upper:]' '[:lower:]'))"
export PRE_RELEASE=false
bash deploy.sh
if [[ "$TRAVIS_TAG" =~ -.+ ]]; then
export PRE_RELEASE=true
fi
deploy:
provider: releases
api_key:
secure: es9Y5dmO4kbLNIyPdjJm8dYa03LG9CiCdhjIBtvrRdWX1uPULh8+yFERdEANDzeE1AFkcfNU0vnLIIFVj5VyXfRyfvaNyLrDWkFSwF9q3rKvkcD6PNDZkong8zgAWNGDF6GRRErXTMXQzitNW2NHhhli/C6ai8Q0Ee+krnBeKavJCAylMrAsBXJd6JZmzk/ZVyni3Sg6zgnu/vruBpc3puXlonJsxlVkpHsdGOF7FC5WL2aIr50Mw8tdBlhXHhA3izFipblQCd2lHbrUpWOayB9zNBVvdJyxFMyoYK3Mn1WWNJ5UHC4HcvDMv3AMg7fanoEB8R5MMWrMeWWAYtfD8y7xNVtPUpquxyOgGTBCQdmL8EmcqUWalot4SkfxOdZIOeSsVQMOokORXM6iCHC5+cv2XUyRdSPKMok5sTXzfI3/9gOKU/I6k/v+V3TNUq/OTTOqnMJb8fHTjyK44ON9nbekckrC5yUq3n2GtHu5gUJfszkZVimRkjgUSDlRXUuNxrHd0m8O4mByHkwGj0ajDeeb+FYQCo9YJ1lPpiC9V7HeqfMF/+OEV5xModBElLQU/bEjipqN37N1shFifyIDJLBpVyodO1OpT705aRRl3EOUvt9LIiJXUUx+JTY6sOC2gg1mIZbo2hsLpaud6rUgdPC67ljy2gBmMC30UtpM+E8=
name: $TRAVIS_TAG
body: ${BODY}
prerelease: $PRE_RELEASE
file_glob: true
file: ../artifacts/*
skip_cleanup: true
on:
tags: true
condition: "$TO_DEPLOY = yes"
branch: master