forked from rai-project/rai
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
112 lines (111 loc) · 8 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
dist: xenial
sudo: required
language: go
go: '1.11.x'
before_install:
- sudo dpkg --print-foreign-architectures
- sudo dpkg --add-architecture i386
- sudo apt-get install -qq --force-yes build-essential gcc-multilib g++-multilib > /dev/null
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- gem install --no-ri --no-rdoc fpm
- go get -u golang.org/x/tools/cmd/stringer
- go get -u golang.org/x/tools/cmd/cover
- go get github.com/mjibson/esc
- go get github.com/ahmetb/govvv
- go get github.com/mitchellh/gox
- go get github.com/tcnksm/ghr
- go get github.com/sanbornm/go-selfupdate
- go get github.com/laher/bump/...
- go get github.com/gordonklaus/ineffassign
- go get github.com/client9/misspell/cmd/misspell
- go get -u github.com/goreleaser/nfpm/...
- go get github.com/aktau/github-release
- cd ${TRAVIS_BUILD_DIR}
- sed -i "s/\${APP_SECRET}/${APP_SECRET}/" ${TRAVIS_BUILD_DIR}/.goreleaser.yml
- dep ensure -v
script:
- echo "Skip tests..."
- VERSION=$(cat ./VERSION)
- echo "VERSION = ${VERSION}"
- DIST=${TRAVIS_BUILD_DIR}/dist/rai/stable
- gox -verbose -parallel=4 -cgo=false -osarch="darwin/386 darwin/amd64 linux/386 linux/amd64 linux/armv5 linux/armv6 linux/armv7" -ldflags="$(govvv
-flags) -s -w -X main.AppSecret=${APP_SECRET} -extldflags \"-static\"" -output="${DIST}/${VERSION}/{{.OS}}-{{.Arch}}/{{.Dir}}"
.
- gox -verbose -parallel=4 -cgo=false -osarch="linux/ppc64 linux/ppc64le windows/386 windows/amd64" -ldflags="$(govvv
-flags) -s -w -X main.AppSecret=${APP_SECRET} -extldflags \"-static\"" -output="${DIST}/${VERSION}/{{.OS}}-{{.Arch}}/{{.Dir}}"
.
#- gox -verbose -parallel=4 -cgo=false -osarch="linux/arm64" -ldflags="$(govvv
# -flags) -s -w -X main.AppSecret=${APP_SECRET} -extldflags \"-static\"" -output="${DIST}/${VERSION}/{{.OS}}-{{.Arch}}/{{.Dir}}"
# .
before_deploy:
- echo "go-selfupdate generating bindiffs"
- mkdir -p ${DIST}/${VERSION}/binaries
- mkdir -p ${DIST}/latest
- tar --transform 's/.*\///g' -czvf ${DIST}/${VERSION}/binaries/darwin-386 ${DIST}/${VERSION}/darwin-386/rai ${TRAVIS_BUILD_DIR}/LICENSE.TXT
${TRAVIS_BUILD_DIR}/VERSION || true
- tar --transform 's/.*\///g' -czvf ${DIST}/${VERSION}/binaries/darwin-amd64 ${DIST}/${VERSION}/darwin-amd64/rai ${TRAVIS_BUILD_DIR}/LICENSE.TXT
${TRAVIS_BUILD_DIR}/VERSION || true
- tar --transform 's/.*\///g' -czvf ${DIST}/${VERSION}/binaries/linux-386 ${DIST}/${VERSION}/linux-386/rai ${TRAVIS_BUILD_DIR}/LICENSE.TXT
${TRAVIS_BUILD_DIR}/VERSION || true
- tar --transform 's/.*\///g' -czvf ${DIST}/${VERSION}/binaries/linux-amd64 ${DIST}/${VERSION}/linux-amd64/rai ${TRAVIS_BUILD_DIR}/LICENSE.TXT
${TRAVIS_BUILD_DIR}/VERSION || true
- tar --transform 's/.*\///g' -czvf ${DIST}/${VERSION}/binaries/linux-armv5 ${DIST}/${VERSION}/linux-armv5/rai ${TRAVIS_BUILD_DIR}/LICENSE.TXT
${TRAVIS_BUILD_DIR}/VERSION || true
- tar --transform 's/.*\///g' -czvf ${DIST}/${VERSION}/binaries/linux-armv6 ${DIST}/${VERSION}/linux-armv6/rai ${TRAVIS_BUILD_DIR}/LICENSE.TXT
${TRAVIS_BUILD_DIR}/VERSION || true
- tar --transform 's/.*\///g' -czvf ${DIST}/${VERSION}/binaries/linux-armv7 ${DIST}/${VERSION}/linux-armv7/rai ${TRAVIS_BUILD_DIR}/LICENSE.TXT
${TRAVIS_BUILD_DIR}/VERSION || true
- tar --transform 's/.*\///g' -czvf ${DIST}/${VERSION}/binaries/linux-arm64 ${DIST}/${VERSION}/linux-arm64/rai ${TRAVIS_BUILD_DIR}/LICENSE.TXT
${TRAVIS_BUILD_DIR}/VERSION || true
- tar --transform 's/.*\///g' -czvf ${DIST}/${VERSION}/binaries/linux-ppc64 ${DIST}/${VERSION}/linux-ppc64/rai ${TRAVIS_BUILD_DIR}/LICENSE.TXT
${TRAVIS_BUILD_DIR}/VERSION || true
- tar --transform 's/.*\///g' -czvf ${DIST}/${VERSION}/binaries/linux-ppc64le ${DIST}/${VERSION}/linux-ppc64le/rai ${TRAVIS_BUILD_DIR}/LICENSE.TXT
${TRAVIS_BUILD_DIR}/VERSION || true
- tar --transform 's/.*\///g' -czvf ${DIST}/${VERSION}/binaries/windows-386 ${DIST}/${VERSION}/windows-386/rai.exe ${TRAVIS_BUILD_DIR}/LICENSE.TXT
${TRAVIS_BUILD_DIR}/VERSION || true
- tar --transform 's/.*\///g' -czvf ${DIST}/${VERSION}/binaries/windows-amd64 ${DIST}/${VERSION}/windows-amd64/rai.exe
${TRAVIS_BUILD_DIR}/LICENSE.TXT ${TRAVIS_BUILD_DIR}/VERSION || true
- go-selfupdate -o ${DIST}/updates ${DIST}/${VERSION}/binaries/ ${VERSION}
- cp ${DIST}/${VERSION}/binaries/darwin-386 ${DIST}/latest/darwin-386.tar.gz || true
- cp ${DIST}/${VERSION}/binaries/darwin-amd64 ${DIST}/latest/darwin-amd64.tar.gz || true
- cp ${DIST}/${VERSION}/binaries/linux-386 ${DIST}/latest/linux-386.tar.gz || true
- cp ${DIST}/${VERSION}/binaries/linux-amd64 ${DIST}/latest/linux-amd64.tar.gz || true
- cp ${DIST}/${VERSION}/binaries/linux-armv5 ${DIST}/latest/linux-armv5.tar.gz || true
- cp ${DIST}/${VERSION}/binaries/linux-armv6 ${DIST}/latest/linux-armv6.tar.gz || true
- cp ${DIST}/${VERSION}/binaries/linux-armv7 ${DIST}/latest/linux-armv7.tar.gz || true
- cp ${DIST}/${VERSION}/binaries/linux-arm64 ${DIST}/latest/linux-arm64.tar.gz || true
- cp ${DIST}/${VERSION}/binaries/linux-ppc64 ${DIST}/latest/linux-ppc64.tar.gz || true
- cp ${DIST}/${VERSION}/binaries/linux-ppc64le ${DIST}/latest/linux-ppc64le.tar.gz || true
- cp ${DIST}/${VERSION}/binaries/windows-386 ${DIST}/latest/windows-386.tar.gz || true
- cp ${DIST}/${VERSION}/binaries/windows-amd64 ${DIST}/latest/windows-amd64.tar.gz || true
- rm -fr ${DIST}/${VERSION}/binaries
- echo "Copying latest directory to ${DIST}/${TRAVIS_COMMIT}"
- cp -r ${DIST}/latest ${DIST}/${TRAVIS_COMMIT}
after_deploy:
- echo "releasing v${VERSION}..."
- ghr -t "$GITHUB_TOKEN" -u rai-project -r rai --replace "v${VERSION}" "${DIST}/latest"
- cd ${TRAVIS_BUILD_DIR}
deploy:
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash
on:
tags: true
condition: $TRAVIS_OS_NAME = linux
deploy:
provider: s3
access_key_id: AKIAIAFSJLCCOYB5V3EQ
secret_access_key:
secure: TybhA8dNkfZFmMA/gcg5XlwsoqDuZKmUTVghW91xHrf8g+x6JQQTHuIzEIAIYbnOKN8IKPtgodDi2fotzPXghe0yB2lYe5MWaDG303cfAKfrdyqeaKLVIgjF80RPULmFHkosKfb3TlKJLAZxYMOJwxcENkGmePt35hM1lti/DtAq4VMjkjMAP5jLRb2e07u6B5uG1/DNbCqaAtgNtWuVqG5+KUOQBz6CKt/VVdt5DdFcL3fOsXqfMyrxKWoUEgUUcOIHoDBnaexcWPh07v3Vg5DiG3Sj18nieb1MiR8FkNwEBF+bz7yjL+4l8BGk7bVRlhY6QpjPdAIiT9p0C5b0LOsn9LKO0wKiAn49D6v7SJDOum6E5Njw9Hl+Uv/1g9X+zH2z+fjDDjqpUySEIKNF/zSQeLMYyIjobzKqFOTXz/oI31TzOWcJVxj1mKHInbQzBKIYluaGNraj9KZGB5Gv0BRbRkGkPRakD18TVotEN9gT6SFCRs7zs7bggU5VGawNO51qJCp8EUwT10ClU+2IG92TipGiHtIj3jyDPamje9riKeWz+ktYVGK0AmkcneGiwmVB9Zx6E6Jhytj3tNadpNJoii8Qo8KLesYwZ1IUDkPfEuF5QQXVOyxy/wfhwyVFpQmzuR3dXI86JBcphNQJNiB2myl/zMn80o80WslCgYA=
bucket: files.rai-project.com
local-dir: dist
upload-dir: dist
acl: public_read
skip_cleanup: true
detect_encoding: true
on:
repo: rai-project/rai
env:
global:
- secure: IQp/wVvtpcT8ya+ZBWA15IX13iBG8adP5ah+8eV7ijsY9zwCl+yqIIuQqzg+FNg4jjSElCgUrKQZmhgjdNjyi5/4V2KNMqvEICx+RzDixqyAUpcnuEOFi1c33Klb3QgXa4gh6EVDNhNEMxzb9n11133uAY/OLi3wXMAnWKLn0cDze0ji0ji6Lgb5rMuBomSbhD+Br49yje0JFk/MJjDsVyLt9YtvEdhoDYXEvpnLCGvivRnA3MdzSXaS59IyjFufqtp8aCR6YRXTPY/hPyGrw4Gfcj4ygBh2M4hJ/gn4J/UyI+c9WIe9+yejJtwBhsscGlhr7VJLAF/5LiRfZqXIerAvKDzaUuqMpN3u43SMzrHjcq3Hw84MFCOraSo+qHINiHMsYC11sY8yydrkiumkW1EAvSE7k24M/xKwQ1l9RcfZSBvxoqppiVLzu5QmLi99VGclT/vAJMnADOSQ40+KYjtlRoJGeWbQeOc+2FfSe3Sl0JS+oDvDKVuY6D4U6ld3uGsR8zwjvO16WUfRJcw3hoDajkJ4AYPjZsUfCFdEF/6uQuc1ZHFg94bbwrYay6YG92KtfI74fEIu1ia5TeY7OpMy42C6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