forked from unpoller/unpoller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
143 lines (143 loc) · 7.34 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# 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 -v 1.11.0; 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:
# Unstable (master pushes).
- provider: packagecloud
repository: unstable
username: golift
token:
secure: 1vzsIxgcDkMkkmxpvaw3vEMt4cbDNpk3UMeiv5qnHJ9/k0D6+VhNVS0I3QLgP5+WQgH11Y0YX00NvcY13M+hSj6vLhPCBroFisXJyDpg/f/bxyHxILFeO6AY/CSFbdLzyLcjJo5SC7JedEhqd4xeqjEo14FxGrzKB7guOBCdOQPtaFxfimm02vNt34LoLGYOfZMek2vt50qAR8ChvX2fG/gGxfAlQ4AYvppJLwfPs4jwMN1rrndDI1EUgy3ZMafM40KguXD2wGkctLmyoelTEX2TEDa8TBZKot3lRmK1vyI3wCzNY/Jb5chGq9J5zWFpPlSvn+NPeqj+8UGCZ+bCb0unFH5OdOEKTmQ46cYgL6d3RRbpwoxbG/twg/bAfJ0iiSNTJfXjXDLKT9j+YyeCerbnh7rT/qCuwO+W/HIsnu0waCXvXGAKXGAAE+xvnBygp/YS6I4Y26V2CBIF8KJEWIF/CuooHzraa5c1hg50h5YZnZ9EwVXxFRdsFSNxle9uNe2iJ08FEV6VyHPybYsOnA37yM7E8wCLbcKRKavAyVT7OykLU2GAAOCdcN8tpSDA/kwKx3imZhyjGGUrYQxVN/bCb4hhBX+OymcVIw2gQFkJ/sc09ck+Vo77FVR6JVi0tCjan7x4oCTQfbEa5lkioMjKgY6JDfRVZdX6HUjlJTw=
dist: ubuntu/focal
local-dir: release
package_glob: "*.deb"
skip_cleanup: true
cleanup: false
on:
branch: unstable
condition: "$TRAVIS_OS_NAME = linux"
- provider: packagecloud
repository: unstable
username: golift
token:
secure: 1vzsIxgcDkMkkmxpvaw3vEMt4cbDNpk3UMeiv5qnHJ9/k0D6+VhNVS0I3QLgP5+WQgH11Y0YX00NvcY13M+hSj6vLhPCBroFisXJyDpg/f/bxyHxILFeO6AY/CSFbdLzyLcjJo5SC7JedEhqd4xeqjEo14FxGrzKB7guOBCdOQPtaFxfimm02vNt34LoLGYOfZMek2vt50qAR8ChvX2fG/gGxfAlQ4AYvppJLwfPs4jwMN1rrndDI1EUgy3ZMafM40KguXD2wGkctLmyoelTEX2TEDa8TBZKot3lRmK1vyI3wCzNY/Jb5chGq9J5zWFpPlSvn+NPeqj+8UGCZ+bCb0unFH5OdOEKTmQ46cYgL6d3RRbpwoxbG/twg/bAfJ0iiSNTJfXjXDLKT9j+YyeCerbnh7rT/qCuwO+W/HIsnu0waCXvXGAKXGAAE+xvnBygp/YS6I4Y26V2CBIF8KJEWIF/CuooHzraa5c1hg50h5YZnZ9EwVXxFRdsFSNxle9uNe2iJ08FEV6VyHPybYsOnA37yM7E8wCLbcKRKavAyVT7OykLU2GAAOCdcN8tpSDA/kwKx3imZhyjGGUrYQxVN/bCb4hhBX+OymcVIw2gQFkJ/sc09ck+Vo77FVR6JVi0tCjan7x4oCTQfbEa5lkioMjKgY6JDfRVZdX6HUjlJTw=
dist: el/6
local-dir: release
package_glob: "*.rpm"
skip_cleanup: true
cleanup: false
on:
branch: unstable
condition: "$TRAVIS_OS_NAME = linux"
# Stable packages (releases).
- provider: packagecloud
repository: pkgs
username: golift
token:
secure: 1vzsIxgcDkMkkmxpvaw3vEMt4cbDNpk3UMeiv5qnHJ9/k0D6+VhNVS0I3QLgP5+WQgH11Y0YX00NvcY13M+hSj6vLhPCBroFisXJyDpg/f/bxyHxILFeO6AY/CSFbdLzyLcjJo5SC7JedEhqd4xeqjEo14FxGrzKB7guOBCdOQPtaFxfimm02vNt34LoLGYOfZMek2vt50qAR8ChvX2fG/gGxfAlQ4AYvppJLwfPs4jwMN1rrndDI1EUgy3ZMafM40KguXD2wGkctLmyoelTEX2TEDa8TBZKot3lRmK1vyI3wCzNY/Jb5chGq9J5zWFpPlSvn+NPeqj+8UGCZ+bCb0unFH5OdOEKTmQ46cYgL6d3RRbpwoxbG/twg/bAfJ0iiSNTJfXjXDLKT9j+YyeCerbnh7rT/qCuwO+W/HIsnu0waCXvXGAKXGAAE+xvnBygp/YS6I4Y26V2CBIF8KJEWIF/CuooHzraa5c1hg50h5YZnZ9EwVXxFRdsFSNxle9uNe2iJ08FEV6VyHPybYsOnA37yM7E8wCLbcKRKavAyVT7OykLU2GAAOCdcN8tpSDA/kwKx3imZhyjGGUrYQxVN/bCb4hhBX+OymcVIw2gQFkJ/sc09ck+Vo77FVR6JVi0tCjan7x4oCTQfbEa5lkioMjKgY6JDfRVZdX6HUjlJTw=
dist: ubuntu/focal
local-dir: release
package_glob: "*.deb"
skip_cleanup: true
cleanup: false
on:
tags: true
condition: "$TRAVIS_OS_NAME = linux"
- provider: packagecloud
repository: pkgs
username: golift
token:
secure: 1vzsIxgcDkMkkmxpvaw3vEMt4cbDNpk3UMeiv5qnHJ9/k0D6+VhNVS0I3QLgP5+WQgH11Y0YX00NvcY13M+hSj6vLhPCBroFisXJyDpg/f/bxyHxILFeO6AY/CSFbdLzyLcjJo5SC7JedEhqd4xeqjEo14FxGrzKB7guOBCdOQPtaFxfimm02vNt34LoLGYOfZMek2vt50qAR8ChvX2fG/gGxfAlQ4AYvppJLwfPs4jwMN1rrndDI1EUgy3ZMafM40KguXD2wGkctLmyoelTEX2TEDa8TBZKot3lRmK1vyI3wCzNY/Jb5chGq9J5zWFpPlSvn+NPeqj+8UGCZ+bCb0unFH5OdOEKTmQ46cYgL6d3RRbpwoxbG/twg/bAfJ0iiSNTJfXjXDLKT9j+YyeCerbnh7rT/qCuwO+W/HIsnu0waCXvXGAKXGAAE+xvnBygp/YS6I4Y26V2CBIF8KJEWIF/CuooHzraa5c1hg50h5YZnZ9EwVXxFRdsFSNxle9uNe2iJ08FEV6VyHPybYsOnA37yM7E8wCLbcKRKavAyVT7OykLU2GAAOCdcN8tpSDA/kwKx3imZhyjGGUrYQxVN/bCb4hhBX+OymcVIw2gQFkJ/sc09ck+Vo77FVR6JVi0tCjan7x4oCTQfbEa5lkioMjKgY6JDfRVZdX6HUjlJTw=
dist: el/6
local-dir: release
package_glob: "*.rpm"
skip_cleanup: true
cleanup: false
on:
tags: true
condition: "$TRAVIS_OS_NAME = linux"
# Upload built files to github too.
- provider: releases
api_key:
secure: GsvW0m+EnRELQMk8DjH63VXinqbwse4FJ4vNUslOE6CZ8PBXPrH0ZgaI7ic/uxRtm7CYj0sir4CZq62W5l6uhoXCCQfjOnmJspqnQcrFZ1xRdWktsNXaRwM6hlzaUThsJ/1PD9Psc66uKXBYTg0IlUz0yjZAZk7tCUE4libuj41z40ZKxUcbfcNvH4Njc9IpNB4QSA3ss+a9/6ZwBz4tHVamsGIrzaE0Zf99ItNBYvaOwhM2rC/NWIsFmwt8w4rIA2NIrkZgMDV+Z2Niqh4JRLAWCQNx/RjC5U52lG2yhqivUC3TromZ+q4O4alUltsyIzF2nVanLWgJmbeFo8uXT5A+gd3ovSkFLU9medXd9i4kap7kN/o5m9p5QZvrdEYHEmIU4ml5rjT2EQQVy5CtSmpiRAbhpEJIvA1wDtRq8rdz8IVfJXkHNjg2XdouNmMMWqa3OkEPw21+uxsqv4LscW/6ZjsavzL5SSdnBRU9n79EfGJE/tJLKiNumah/vLuJ5buNhgqmCdtX/Tg+DhQS1BOyYg4l4L8s9IIKZgFRwrOPsZnA/KsrWg4ZsjJ87cqKCaT/qs2EJx5odZcZWJYLBngeO8Tc6cQtLgJdieY2oEKo51Agq4rgikZDt21m6TY9/R5lPN0piwdpy3ZGKfv1ijXx74raMT03qskputzMCvc=
overwrite: true
skip_cleanup: true
cleanup: false
file_glob: true
file: release/*
on:
tags: true
# Upload homebrew formula file to a special repo.
- provider: script
script: scripts/formula-deploy.sh
on:
tags: true