Skip to content

Commit 51f5d0c

Browse files
authored
Merge pull request #341 from erizocosmico/feature/cross-compile-macos
travis: build and upload macOS releases
2 parents 944bf2f + bf6a9e9 commit 51f5d0c

File tree

1 file changed

+50
-23
lines changed

1 file changed

+50
-23
lines changed

.travis.yml

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
language: go
2-
sudo: required
3-
4-
go:
5-
- "1.9.x"
6-
- "1.10.x"
7-
- tip
8-
9-
services:
10-
- docker
112

123
go_import_path: github.com/src-d/gitbase
134

@@ -28,10 +19,10 @@ before_install:
2819
- docker pull pilosa/pilosa:v0.9.0
2920
- docker run -d --name pilosa -p 127.0.0.1:10101:10101 pilosa/pilosa:v0.9.0
3021
- docker ps -a
31-
32-
install:
3322
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
3423
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 90
24+
25+
install:
3526
- cd ./vendor/gopkg.in/bblfsh/client-go.v2
3627
- make dependencies
3728
- cd ./../../../..
@@ -45,17 +36,53 @@ before_script:
4536
script:
4637
- make test-coverage codecov
4738

48-
before_deploy:
49-
- make packages
39+
jobs:
40+
include:
41+
- go: 1.10.x
42+
os: linux
43+
sudo: required
44+
dist: trusty
45+
services: [docker]
46+
47+
before_deploy:
48+
- make packages
49+
50+
after_deploy:
51+
- DOCKER_PUSH_LATEST=1 make docker-push
52+
53+
deploy:
54+
provider: releases
55+
api_key: $GITHUB_TOKEN
56+
file_glob: true
57+
file: build/*linux_amd64.tar.gz
58+
skip_cleanup: true
59+
on:
60+
tags: true
61+
62+
- {go: tip, os: linux, sudo: required, dist: trusty, services: [docker]}
63+
64+
- go: 1.10.x
65+
os: osx
66+
osx_image: xcode9.3
67+
68+
before_install:
69+
- echo "skipping before_install for macOS"
70+
71+
before_script:
72+
- echo "skipping before_script for macOS"
5073

51-
deploy:
52-
provider: releases
53-
api_key: $GITHUB_TOKEN
54-
file_glob: true
55-
file: build/*.tar.gz
56-
skip_cleanup: true
57-
on:
58-
tags: true
74+
script:
75+
- make packages || echo "" # will fail because of docker being missing
76+
- if [ ! -f "build/gitbase_darwin_amd64/gitbase" ]; then echo "gitbase binary not generated" && exit 1; fi
77+
- cd build
78+
- tar -cvzf "gitbase_${TRAVIS_TAG}_darwin_amd64.tar.gz" gitbase_darwin_amd64
79+
- cd ..
5980

60-
after_deploy:
61-
- DOCKER_PUSH_LATEST=1 make docker-push
81+
deploy:
82+
provider: releases
83+
api_key: $GITHUB_TOKEN
84+
file_glob: true,
85+
file: build/*darwin_amd64.tar.gz
86+
skip_cleanup: true
87+
on:
88+
tags: true

0 commit comments

Comments
 (0)