forked from mysteriumnetwork/node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
153 lines (129 loc) · 4.73 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
sudo: true
os: linux
language: go
go: ["1.11"]
go_import_path: github.com/mysteriumnetwork/node
env:
global:
- BUILD_COMMIT=$TRAVIS_COMMIT
- BUILD_BRANCH=$TRAVIS_BRANCH
- BUILD_NUMBER=$TRAVIS_BUILD_NUMBER
- BUILD_VERSION=$TRAVIS_TAG
before_install:
- if [ -z "$BUILD_VERSION" ]; then
export BUILD_VERSION=$(
curl -s -H "Authorization:token $GIT_RELEASES_API_KEY"
https://api.github.com/repos/${TRAVIS_REPO_SLUG}/releases |
jq -r '( first(.[] | select(.prerelease == true)) ) | .tag_name');
fi
cache:
directories:
- vendor
stages:
- dep-cache
- test
- name: build
if: (type != pull_request AND branch = master AND tag IS blank) OR tag IS present
- name: release-dev
if: type != pull_request AND branch = master AND tag IS blank
- name: release
if: tag IS present
jobs:
include:
# Dependencies cache stage
- stage: dep-cache
name: "Vendor update"
script:
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- dep ensure
# Test stage
- stage: test
script: bin/test
name: "Unit tests"
- script: bin/test_e2e
name: "End-to-end tests"
if: type = pull_request
- script: bin/builder_run bin/check_golint
name: "golint check"
- script: bin/builder_run bin/check_goimports
name: "goimports check"
- script: bin/check_license
name: "license check"
- script: bin/check_govet
name: "govet check"
# Build artifacts
- stage: build
script:
- BINARY=build/myst/myst_linux_amd64 bin/package_standalone linux
- bin/s3 sync build/package s3://build-artifacts
name: "Linux packages"
- script:
- bin/builder_run BINARY=build/myst/myst bin/package_debian $BUILD_VERSION amd64
- bin/s3 sync build/package s3://build-artifacts
name: "DEB packages"
- script:
- BINARY=build/myst/myst_darwin_amd64 bin/package_standalone darwin
- bin/s3 sync build/package s3://build-artifacts
name: "OSX packages"
- script:
- BINARY=build/myst/myst_windows_amd64.exe bin/package_standalone windows
- bin/s3 sync build/package s3://build-artifacts
name: "Windows packages"
- script:
- bin/package_ios amd64
- bin/s3 sync build/package s3://build-artifacts
name: "iOS packages"
- script:
- bin/package_android amd64
- bin/s3 sync build/package s3://build-artifacts
name: "Android packages"
- script:
- bin/package_docker
- docker save myst:alpine | gzip > myst_alpine.tgz
- bin/s3 cp myst_alpine.tgz s3://docker-images
name: "Alpine docker image"
- script:
- bin/package_docker_ubuntu $BUILD_VERSION
- docker save myst:ubuntu | gzip > myst_ubuntu.tgz
- bin/s3 cp myst_ubuntu.tgz s3://docker-images
name: "Ubuntu docker image"
# Development bleeding-edge release (on master commits only)
- stage: release-dev
script:
- git tag -f $BUILD_VERSION
- git remote add gh https://${TRAVIS_REPO_SLUG%/*}:${GIT_RELEASES_API_KEY}@github.com/${TRAVIS_REPO_SLUG}.git
- git push -f gh $BUILD_VERSION
- script:
- bin/release_goreport
name: "Update Go Report Card"
# Official release (on tags only)
- stage: release
script: bin/s3 sync s3://build-artifacts build/package
name: "Official release (on tags only)"
deploy:
provider: releases
file_glob: true
file: build/package/*
skip_cleanup: true
api_key: "$GIT_RELEASES_API_KEY"
on:
tags: true
- script:
- bin/s3 sync s3://docker-images build/docker
- docker load -i build/docker/myst_alpine.tgz
- docker load -i build/docker/myst_ubuntu.tgz
- bin/release_docker $TRAVIS_TAG
- if [[ $TRAVIS_TAG != *-rc ]]; then bin/release_docker latest; fi
name: "Pushing release to hub.docker.com"
notifications:
slack:
rooms:
- secure: >
uzg7QbKd09rm6q/7iXk1HFfXo61vqFbENueRM/a6Jg+o2/YZEQXtKLO+gLg2gY/4ok9P4goUF8PuAA1/YLnhzJAr0ks35z69kns36E2eJkU2kB72D8
K44Mi5fhPFrcbbkPPqFtMoeXUkEjNvB6LT3w0xpWOUBS68N/HJrpi2Y3kn1tp96tcsneLyBick3JrlJc3aptHq/bNFLaWFS9orzcp9wWDjxNeWaVze
GM0Y1GCFQymff9UOf2r6Vy/MjESo9QjHH+gJbEzH13d6YcBi2ktZF3c6ZDqsjOOQZKQzwrgYk6sVLQsikDtA0vPgXVVyTVgcYmdTrNF6K/31Dt/e3K
gJXvpwn6tsW6o2DJJpq4MXFOm2z+S20KNbhSj5BLzYmVOKnJhyDAFFYWLDfF0ZJs3D0Pezjtu8HsMvkX3REYXUaBEZuRR4GRV4iqCdyHWKR+WGtX7Y
FfsaolqNiWAqHaACH5jL2oZ4DcwF3x0LfEpESJYJrmmUsCl0/siBe9e5zL3mpwdJ7vG2rH8XUsEJvHf5A8YSYOSLE06lPpioNjskKoGYT0/c8VNAty
OvkdfTsWhz6oCOAZyJsQPuW1vEkjdK/mkrj38g0K4RnMQ05aVbLlHkH+1OUzzPl/NVydoDYdTlkCYTDSL3vrD/Uh5uu57FDssUkz/joiuzixNkePo=
on_success: change
on_failure: always