-
Notifications
You must be signed in to change notification settings - Fork 1
/
.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: ZEi3YC3RgCJS7q6ciJ65AHZyLkRDXHaC+YOBoQgJMIkQIcY5+WPaTN88fM8HlxVcLdtRwSBsVUiyb0tUoMIXAXk7xHTO4ejep+AonFBpcgN+LtqV/Pr/GzgGhIsuy25JX9/QDq/p0CZ/wcszjG8mypCr/tyia5fAl1awL7xORw+RB+NtN7ux6+cR2kRDqIguWqMuLPHe7zeAxVxje3yl231IXiu8bNms5cpMrmhwWcft6Q2LyhH2rib7Uf+lvT7SqN74yEfxbnMFgNqYjutq6c1Yed+f5d2+ExnHFSFQ0CH24LjXvHKKjS2x1MN2nH8aFhI/uqMMyYX9uPsdFXv/u6KJ31FOuB9mdc7ks7sLMPly5vnrtAWvmCyaHQKCUZZreAxxfe5lhTZIINCab9Y2xnA2jg8vBgMXtYVazlQkyF08Vd3O+0ImyXnUn9OXjVw2VIZe8IE0dK2FC5LkvVU4umPGpoJfer9y2hKS+dyeobkYbpFqi8HR8uzcHD/JTqZjhp7yELbQKurOlRa07q5rKjl7y7EmwvLwN/zvvhjYPImePm5rDoJMn58piStKFwGfte0JD6Wx/zCN2aD8h1mURqBYsYpddUKa7dVYUe0ebHnjkK1elC51gwFm2fEj5/wSG7+Jt5jsIwMuXLyKa6mzFR/XA+4nuq0csZBQKUs8qfI=
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: ZEi3YC3RgCJS7q6ciJ65AHZyLkRDXHaC+YOBoQgJMIkQIcY5+WPaTN88fM8HlxVcLdtRwSBsVUiyb0tUoMIXAXk7xHTO4ejep+AonFBpcgN+LtqV/Pr/GzgGhIsuy25JX9/QDq/p0CZ/wcszjG8mypCr/tyia5fAl1awL7xORw+RB+NtN7ux6+cR2kRDqIguWqMuLPHe7zeAxVxje3yl231IXiu8bNms5cpMrmhwWcft6Q2LyhH2rib7Uf+lvT7SqN74yEfxbnMFgNqYjutq6c1Yed+f5d2+ExnHFSFQ0CH24LjXvHKKjS2x1MN2nH8aFhI/uqMMyYX9uPsdFXv/u6KJ31FOuB9mdc7ks7sLMPly5vnrtAWvmCyaHQKCUZZreAxxfe5lhTZIINCab9Y2xnA2jg8vBgMXtYVazlQkyF08Vd3O+0ImyXnUn9OXjVw2VIZe8IE0dK2FC5LkvVU4umPGpoJfer9y2hKS+dyeobkYbpFqi8HR8uzcHD/JTqZjhp7yELbQKurOlRa07q5rKjl7y7EmwvLwN/zvvhjYPImePm5rDoJMn58piStKFwGfte0JD6Wx/zCN2aD8h1mURqBYsYpddUKa7dVYUe0ebHnjkK1elC51gwFm2fEj5/wSG7+Jt5jsIwMuXLyKa6mzFR/XA+4nuq0csZBQKUs8qfI=
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: XvX+YuiOBLwH0U1h5whb6G8oS1pq8j87/s+otSptgP1RprJ5XcTKidfHl3t8bTjYeE0fWBq82nb+Fr830DWDAjY73DZeju0zg+hfg8RcZBKvzo1yR3h8iIHPrU2M1NRUpwZA+RuUul1X0rua30li/oqZR3W3hsFSCa3boqJeXLyu2No7JQ+OCENhvuNEz4qMTNhChqd1XYPXb4Y2+hYchhd890X1T9YdcI231rKzJ5uswix3YNqDHKa7esteVTU1U5KyAmEcPGDlXlL76POGupVVxDo2X884JfXdneyJ2cSmYp+dkYK1hdTiu2HNgruRCH9JDTfduQOg4BEuUIbB0b0ZRHmDT7BgtQ8Q21a83jGcsWW9HIRsoAoKjvV0ULxssXs0xIWvly1cE9ZFhew3wa8F37tfetlRpBrEDMIcKC3u0wV2xA/M9qc6TOke6ZD3+HHfzbGiT/2mlV2K9kHzgpFYjHbb5UOsyQS4AXm0N2LE4/RbnODI6kbJTSNqE+xVf0qszlPXMe9whWYxYR48X3O2bmSo8qegZ0CGJZW1qcDoMZ/WFp9fKe7348/eVBbP/X0zEcv6ChH0Rrrmq2fbBFp3tQ6nMwI+eIAyxQFan1rg8VjsiR2IVKMjrR7D4VZA6SorJ0xa/u7yBq86fV7a3LP3iNDht9M0DEgINMWNDdc=
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"