forked from JonasProgrammer/docker-machine-driver-hetzner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
43 lines (41 loc) · 2.49 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
# Builds the docker-machine-driver-hetzner and releases it, if the build is a tag
# (due to the deploy.on.tags=true below).
#
# To make it work, create and encrypt an OAuth token for the Github API as follows:
# (1) Go to https://github.com/settings/tokens and create a new private token
# with scope "public_repo".
# (2) Convert the token into a Travis secret as described at
# https://docs.travis-ci.com/user/encryption-keys/:
# * (assuming you are on a shell with the current working directory being
# inside a local working copy of your Github project)
# * gem install travis
# * travis encypt <the token created in step (1)>
# * add the secure: "<encrypted token>" to the travis.yml file as a key
# below the api_key
language: go
go:
- stable
env:
global:
- GO111MODULE=on
- CGO_ENABLED=0
before_deploy:
# Create binaries for many OSs and architures as tarballs.
# the -osarch="!a/b !c/d" option is used to exclude OS-arch pairs
# a/b and c/d from the build. OS-arch pairs might e.g. be excluded
# they failed to build.
- go get github.com/mitchellh/gox
- mkdir releases
- gox -osarch='!netbsd/arm !openbsd/386 !openbsd/amd64 !netbsd/386 !netbsd/amd64' -output="releases/{{.Dir}}_`git describe --tags --abbrev=0`_{{.OS}}_{{.Arch}}/{{.Dir}}" -ldflags "-X main.Version=`git describe --tags --abbrev=0`"
# Loop through the built architecture directories and create their corresponding tar.gz archives with the binary in it.
- find releases -maxdepth 2 -mindepth 2 -type f -exec bash -c 'tar -cvzf "$(dirname {}).tar.gz" -C "$(dirname {})" $(basename {})' \;
deploy:
# See https://docs.travis-ci.com/user/deployment/releases/
provider: releases
api_key:
secure: "iP4OADhPOZm3xDPkjO6PhNHGGC+iNAEhwIe/weZ2LgegkxThc2KwiWTB/rkjLVOV4NV/zg37ScIADCJCpvKSsSlQs+f6kWc1y2Hf7VLmFy5enu8Q/EcnbS268RwlpwVi3JR01kWRWVTiQn0ia77mw++gVWv93cfEnLoyy1TptyrcuaBDNibVulH6MN5nZFwI/DhKCLoDARcIPO1cC9f0maf1jJ+hhM4kqSnWt201TT+GOsovuTg0eGZeUDRZRlizj25CoQyy9GffyMq9v7AOWoujj4VK269dDSC41XlHr/qE6Czs1CGnTrV7RaIhN2UQMRJsQlRA1vMpzVNxDst5ZuBx3N+KbVtRlGrRTsty5U87fVP/VQYI+ot21KG2ycTjm44xDKozw574WwXdsEj3A7PVMHnjL5QpOVL9je2O6kqrEyr2WOgWkxalQZS1QthNyrHnQFxupA4IeV6hvPakFAAMofiMwCcHrmMeXR8HJ3CzWtDHuI2bwubIOGlueNaSs9ws1XFK333RCfvZEojGPG4pjf/cCtqL/Hguq4/XS2BxTCm6m1c2SqBdW5XOAX9YELQCNixmlD2XLrgivnTTkmcuVfFcoG1XNrrWZBVK3Jz2g4LwDb1Aje/ENlgtAK7pIiMt6FOhRZNMyBU1xEI2WoaUStaWhfZoKolK5w4yuq4="
file_glob: true # enables wildcards in file names
file: "releases/*.tar.gz"
skip_cleanup: true
on:
tags: true