This repository has been archived by the owner on Jun 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
51 lines (46 loc) · 1.67 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
language: go
os:
- linux
go:
- 1.10.1
sudo: required
script:
- go get -t ./...
- go generate
- go test ./...
- go get github.com/karalabe/xgo
- |
# Get the full go repo url
REPO=$(pwd | rev | cut -d'/' -f-3 | rev)
# Get the name of the app
APP="${PWD##*/}"
# Get this tag as the version
VERSION=$(git describe --abbrev=0 --tags)
# Ensure a fresh build folder
rm -rf build && mkdir build
# Compile
xgo \
-dest build/ \
-buildmode=plugin \
--targets=darwin/amd64,freebsd/386,freebsd/amd64,freebsd/arm,linux/386,linux/amd64,linux/arm64 \
--ldflags "-X plugin.version=${VERSION}" \
$REPO
# Package
cd build
# For each compiled binary, we're repackaging it in a zip with the architecture name, and
# renaming the binary to the app name
for FILE in $(ls .); do
mv $FILE $APP.so
tar cvzf ${FILE}.tgz $APP.so
rm -f $APP.so
done
cd ..
deploy:
provider: releases
api_key:
secure: Tsw0la4Hg6hy/reV97/URo0rW4ivekqGlLzLKoRKmurdyYM/EtF7Cwkjxq1NXIkZVjyEe6b9REdgty0WM4hMJOGHJxI2baB4NRHgyH3xFA6FHnw5LONuYPeb1lvRXb+9YZbLKoRvc27AgP3RuwQZTc/X2DAtqXg17PNdebYNgCRglNUO2HkxduaTZ9w1AXc0mSSMHsyYTjmlgDwDedTiP3rePtphZRGB5D6ZZ7sWV11xv03NzFX87I1a7ry145Vou4i/eyVNzIENZ+a+RcjpxF1XoGjTKUoP4kaxg74d44H/Cfo/4vzDtS3WBbccAMREK+GqNn2d22qaigbGio8wc6grBWugfkVssRYxEuPOzijlZ4P9XZQwz3JHmWpTMNkYX2L+RZhED0KjnECHg9dEB3rSnQ0L+bUq4QbouHkN3kALckpRYh6VKoox4IBQ0z/1TjKj++xcguUL/uOL0dJ33wh0tQpX3M495K5d81YP2QpJyLC5yRUM+HMzpTkYlcUU26oawdiof2BjwDVZT18fP47UxoZJUUUGWY0CptSlhM4r128uW/bZuSD8GI4X5OMbfuxJshvGesDTvVUgu24nZ3jmsKoLyrDT8LXAFQ9Noqg5JDZKTgiCkEUFK1Ge/CDPMGlab3+U34DeqiNuoUqHiHGX7/T2paxGGcuddiQg4mo=
file_glob: true
file: "build/*"
skip_cleanup: true
on:
tags: true