This repository has been archived by the owner on Mar 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
117 lines (117 loc) · 5.46 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Powered by Application Builder: https://github.com/golift/application-builder
jobs:
include:
- os: osx
osx_image: xcode12
language: go
go: 1.16.x
- os: linux
dist: bionic
services: docker
language: go
go: 1.16.x
git:
depth: false
addons:
homebrew:
packages:
- upx
apt:
packages:
- ruby-dev
- rpm
- build-essential
- git
- libgnome-keyring-dev
- fakeroot
- zip
- debsigs
- gnupg
- upx
install:
- mkdir -p $(go env GOPATH)/bin
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin latest
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then rvm install 2.6.0; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then rvm 2.6.0 do gem install --no-document fpm; fi
before_script:
# Create your own deploy key, tar it, and encrypt the file to make this work. Optionally add a bitly_token file to the archive.
- openssl aes-256-cbc -K $encrypted_772fc4772f04_key -iv $encrypted_772fc4772f04_iv -in .secret_files.tar.enc -out .secret_files.tar -d
- tar -xf .secret_files.tar
- gpg --import gpg.signing.key
- rm -f gpg.signing.key .secret_files.tar
- source settings.sh
script:
# Test Go.
- make test
# Test Docker.
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then make docker; fi
# Test built docker image.
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then docker run $BINARY -v 2>&1 | grep -Eq "^$BINARY,? v.*$VERSION"; fi
# Build everything
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then rvm 2.6.0 do make release; fi
# Build mac binary or image.
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then make dmg; fi
# Test homebrew (with make install).
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then make install VERSION=$VERSION ITERATION=$ITERATION PREFIX=/tmp/ab-$VERSION ETC=/tmp/ab-$VERSION/etc; fi
after_success:
# Display Release Folder
- ls -l release/
# Setup the ssh client so we can clone and push to the homebrew formula repo.
# You must put github_deploy_file into .secret_files.tar.enc
# This is an ssh key added to your homebrew forumla repo.
- |
mkdir -p $HOME/.ssh
declare -r SSH_FILE="$(mktemp -u $HOME/.ssh/XXXXX)"
echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> $HOME/.ssh/config
[ ! -f github_deploy_key ] || (mv github_deploy_key $SSH_FILE \
&& chmod 600 "$SSH_FILE" \
&& printf "%s\n" \
"Host github.com" \
" IdentityFile $SSH_FILE" \
" StrictHostKeyChecking no" \
" LogLevel ERROR" >> $HOME/.ssh/config)
deploy:
# Stable packages (releases).
- provider: packagecloud
repository: pkgs
username: golift
token:
secure: cClzOaSdnn3xsPxC+uZ+UZAdnfqk1SIiCP79G2/LBOgaW1tXk8Sm/G7/glLwkwjRXuvguPvfMJMejwT6+MtnpKAIhUbEGLYxV6+MMcCwyaimrBn6N0g/BgTUJkxlIaG833UgxNKKmaIoPO5gdqLl3ZZe32Ss2/oM0M/qD+9zwXPxY1R4Yj0WHJFZeACgw7jzbU3/U6BsdpPmrOFKeLuKDaP2d9zzh7BMWt8wYxXyz6zf04+7iLSmSvrqYaI8gIVa/TdsYbfMjENn1s8TTmemLs7UkfmQzTq2Anyby5jDgOyegwfyVyKCjCToM6cvoF7NPfvdX/db38+u1fj3d0G4IYgvqXT1BduLOi/rsFLlBtbpWzlqluRa4GhflR4b4jYWquF9c70dl+nm1kOjSbP2WGlrqO8dUYbvfr9n3Nejq6Pga0UrxDtrDAJJE8QAUju8Jce+oNe1odPwIEak+bdnNHZvZ9ilLE/6nKlvOV3LDUaGGOXeseUxVMUgzW1iINpvOKYXsMta0U5K4SA4OYGmkGhTHWillHWF5ozvhiSgQxQtDk9SRTY+Vyc1ZFadCIeQpra2ANqQ2f26SjtohYOFVmY2cf0b9P7cgAKMyCxfylUjEEGULDWnxzUiajpIBwHPqQsHjn570xAGeBi/LeVS8Df+eE+vAX7T1SveXP1Hz5Y=
dist: ubuntu/focal
local-dir: release
package_glob: "*.deb"
cleanup: false
skip_cleanup: true
on:
tags: true
condition: "$TRAVIS_OS_NAME = linux"
- provider: packagecloud
repository: pkgs
username: golift
token:
secure: cClzOaSdnn3xsPxC+uZ+UZAdnfqk1SIiCP79G2/LBOgaW1tXk8Sm/G7/glLwkwjRXuvguPvfMJMejwT6+MtnpKAIhUbEGLYxV6+MMcCwyaimrBn6N0g/BgTUJkxlIaG833UgxNKKmaIoPO5gdqLl3ZZe32Ss2/oM0M/qD+9zwXPxY1R4Yj0WHJFZeACgw7jzbU3/U6BsdpPmrOFKeLuKDaP2d9zzh7BMWt8wYxXyz6zf04+7iLSmSvrqYaI8gIVa/TdsYbfMjENn1s8TTmemLs7UkfmQzTq2Anyby5jDgOyegwfyVyKCjCToM6cvoF7NPfvdX/db38+u1fj3d0G4IYgvqXT1BduLOi/rsFLlBtbpWzlqluRa4GhflR4b4jYWquF9c70dl+nm1kOjSbP2WGlrqO8dUYbvfr9n3Nejq6Pga0UrxDtrDAJJE8QAUju8Jce+oNe1odPwIEak+bdnNHZvZ9ilLE/6nKlvOV3LDUaGGOXeseUxVMUgzW1iINpvOKYXsMta0U5K4SA4OYGmkGhTHWillHWF5ozvhiSgQxQtDk9SRTY+Vyc1ZFadCIeQpra2ANqQ2f26SjtohYOFVmY2cf0b9P7cgAKMyCxfylUjEEGULDWnxzUiajpIBwHPqQsHjn570xAGeBi/LeVS8Df+eE+vAX7T1SveXP1Hz5Y=
dist: el/6
local-dir: release
package_glob: "*.rpm"
cleanup: false
skip_cleanup: true
on:
tags: true
condition: "$TRAVIS_OS_NAME = linux"
# Upload built files to github too.
- provider: releases
token:
secure: Qrlk91OPyUVgX2DqBGNlKGg2gaXzbwD9gVL0EfG0PPGa9C4ygNL20SYwoLLT9/LNhNrfT2tTel4zRYMXGw0X0VPytPbmCJltmD4+xoSh2qWRk/9uzEZIZrox77z3w4TlfjGCZSrvlCCAIttzvUv5ecFFgMaZboc6IG1IwJoL5aVf+45TzIMH0Tr2lfNmmX6o4Py/Ox/MvfBZMppYzqRSAS12Rbz60+MEYTIvGU6x9MnPyzq1icyD1RaAPirqUkofj82Y7j9Wzf3TDXNWMc7KL/UpA4ApU1sQL1s1emIZBhbP6xkO8uugptF/8vnHhGrC/qCEqjn53CwyIQO51xtPh+ibL+/C1c41NvnQwcHzJ/LIipHaKHqtOda6DARz1hpAfGGlSmWliTDGdaR34a/rkke+1saH+phI/u16AlgLKw4eCvLByILm/p+sOw4zluFNsJ6chfagBBZ2v7jIjJ4PBhv3koF0qQOeF5ne8JruGwDPYTz5S2w8BaahQi4fEEvjRusUxCWZekJBze4Ze6P5vVfzMMBbMAi8JG0UOu5V1Vf9MY39sofp3smTnmCcajYMPzpdHK7s7nYFF+/8597uJZDW1MVJ0Uge1EVbFebAUkBHLmwL6DUm7Ggo2kk+KPbCfipu18uutRP5aZVqfNSWQESzA9s65Sn07fujXxrQ4os=
overwrite: true
cleanup: false
skip_cleanup: true
file_glob: true
file: release/*
on:
tags: true
# Upload homebrew formula file to a special repo.
- provider: script
script: bash scripts/formula-deploy.sh
on:
tags: true
condition: "$TRAVIS_OS_NAME = osx"