forked from codingberg/benchgraph
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
78 lines (68 loc) · 2.06 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
# -*- yaml -*-
language: go
env:
global:
# Package setup (Ref: http://pkg-go.alioth.debian.org/packaging.html)
- VERSION="${TRAVIS_TAG:=0.0~git$(date +%Y%m%d)-1}"
- PKG_NAME="benchgraph"
- PKG_URL="https://github.com/AntonioSun/benchgraph"
- PKG_CAT=utils
- PKG_ARCH=amd64
- PKG_DESC="Visualizing Golang benchmark"
- PKG_VEND="AntonioSun"
- PKG_MAINT='Antonio Sun <[email protected]>'
- PKG_LICNS="MIT"
# Build time setup
- TZ=America/Toronto
- DATE_BUILD=`date -I`
script:
- date
- echo $DATE_BUILD $VERSION
- echo
- go get -t -v ./...
- go build -v -ldflags="-X main.date=$DATE_BUILD"
- benchgraph -help || true
- go test -v ./...
- go get github.com/mitchellh/gox
- gox -ldflags="-X main.date=$DATE_BUILD" -osarch="linux/386 linux/amd64 darwin/amd64 windows/amd64" -output="out/{{.Dir}}-{{.OS}}-{{.Arch}}"
# linux/386 linux/amd64 linux/arm darwin/amd64 darwin/386 windows/amd64 windows/386
# e.g.: out/benchgraph-linux-amd64
# Create Debian Package
- mkdir -p build
- cp -v out/${PKG_NAME}-linux-amd64 build/${PKG_NAME}
- gem install fpm --no-document
- mkdir -p pkg
- >-
fpm --verbose -s dir -t deb
--name ${PKG_NAME}
--package pkg/${PKG_NAME}.deb
--force
--deb-compression bzip2
--url "${PKG_URL}"
--category ${PKG_CAT}
--description "${PKG_DESC}"
--maintainer "${PKG_MAINT}"
--vendor "${PKG_VEND}"
--license "${PKG_LICNS}"
--version ${VERSION}
--architecture ${PKG_ARCH}
--depends apt
--deb-compression gz
./build/=/usr/bin/
# --deb-compression gz: https://unix.stackexchange.com/questions/441032/
- ar t pkg/${PKG_NAME}.deb
- sed -i -e "s/\$VERSION/$VERSION/" bintray-bin.json bintray-pkg.json
- sed -i -e "s/\$DATE/$DATE_BUILD/" bintray-bin.json bintray-pkg.json
deploy:
- provider: bintray
user: antoniosun
key: ${BINTRAY_API_KEY}
file: bintray-bin.json
skip_cleanup: true
- provider: bintray
user: antoniosun
key: $BINTRAY_API_KEY
file: bintray-pkg.json
skip_cleanup: true
on:
# tags: true