forked from pgaskin/repogen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
33 lines (30 loc) · 1.23 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
sudo: false
language: go
go:
- 1.12.x
install:
- go get github.com/tcnksm/ghr
- go get github.com/goreleaser/nfpm/cmd/nfpm
- go install github.com/goreleaser/nfpm/cmd/nfpm
- go install github.com/tcnksm/ghr
script:
- export GO111MODULE=on
- go mod download
- go generate
- go test ./...
- export APP_VERSION=$(git describe --tags --always --dirty)
- export APP_VERSION_NO_V="$(echo "$APP_VERSION" | sed "s/v//g")"
- mkdir build
- GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=$APP_VERSION" -o "build/repogen-linux-64bit"
- GOOS=linux GOARCH=386 go build -ldflags "-X main.version=$APP_VERSION" -o "build/repogen-linux-32bit"
- GOOS=linux GOARCH=arm go build -ldflags "-X main.version=$APP_VERSION" -o "build/repogen-linux-arm"
- nfpm pkg -f nfpm.yaml -t build/repogen_${APP_VERSION_NO_V}_amd64.deb
- sed -i 's/64bit/32bit/g' nfpm.yaml && sed -i 's/amd64/i386/g' nfpm.yaml && nfpm pkg -f nfpm.yaml -t build/repogen_${APP_VERSION_NO_V}_i386.deb
- sed -i 's/32bit/arm/g' nfpm.yaml && sed -i 's/i386/armhf/g' nfpm.yaml && nfpm pkg -f nfpm.yaml -t build/repogen_${APP_VERSION_NO_V}_armhf.deb
deploy:
provider: script
skip_cleanup: true
script: ghr $TRAVIS_TAG build
on:
tags: true
branch: master