-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
117 lines (117 loc) · 5.47 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.17.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 v1.38.0
- 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: AleQRGQdlnK00qurUDIvpkxmXLIVaCNmJrY20qEZKDmbghZkfUVqJoQSMJ8BaEn4Mt6F868oH9UU6FE4TQDef4muMYRC9kO+MTBYxCNaTVTAbewTGlYS8o36eD6r5PZTQByrDWZysTvnLlWq6YZsmmFLPyvJsL6CKo1fNYmH4cPSnoypzUJRZXU7vJTe3ySZOuBm7Xs4aKwMYgOqcMfio7lf5XT14t/7gVyYY1VJuSJOQYcOFv3rsirOgM2WF6I44YRL3KzaJ7rBh4xRQJnLdUm1jBrcQd7V9sET1hbhB24lxz/Hy6kmvFNXIXyo0krug3q9wX5Zoh9cFUZ5iP4Cja40Vgz6shNlczXE4ZAw1ghKKbqGHMepAG5WxnotWzZoL9wKSrpNwHNg3geZXC70//lpPRR+xS8WB7Dz0cz6pLsYrx2L2Hp/eXQj1106+meplXKeR0p8S3MqUq2VsmSBj5d49bg5Y2c3PIZU/Ne3M+pFrFI7O48qhY3hh9oUojWVnEiH/0l/2WrsFfoBeC6uUjiOxg8CvkOX3tdwVbgJq+s1arqBfug95fH0+BsB0N2oKBhBhSLkWaIMHLlx2/xfeyWdmQt+CR1dPRgJxnIDKMJk6qFruBPRtA6x8GKC4cREpK6poxbhh5RJvb3pQ90xjj8dbtBq4o1kdqhuU6ouw9E=
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: AleQRGQdlnK00qurUDIvpkxmXLIVaCNmJrY20qEZKDmbghZkfUVqJoQSMJ8BaEn4Mt6F868oH9UU6FE4TQDef4muMYRC9kO+MTBYxCNaTVTAbewTGlYS8o36eD6r5PZTQByrDWZysTvnLlWq6YZsmmFLPyvJsL6CKo1fNYmH4cPSnoypzUJRZXU7vJTe3ySZOuBm7Xs4aKwMYgOqcMfio7lf5XT14t/7gVyYY1VJuSJOQYcOFv3rsirOgM2WF6I44YRL3KzaJ7rBh4xRQJnLdUm1jBrcQd7V9sET1hbhB24lxz/Hy6kmvFNXIXyo0krug3q9wX5Zoh9cFUZ5iP4Cja40Vgz6shNlczXE4ZAw1ghKKbqGHMepAG5WxnotWzZoL9wKSrpNwHNg3geZXC70//lpPRR+xS8WB7Dz0cz6pLsYrx2L2Hp/eXQj1106+meplXKeR0p8S3MqUq2VsmSBj5d49bg5Y2c3PIZU/Ne3M+pFrFI7O48qhY3hh9oUojWVnEiH/0l/2WrsFfoBeC6uUjiOxg8CvkOX3tdwVbgJq+s1arqBfug95fH0+BsB0N2oKBhBhSLkWaIMHLlx2/xfeyWdmQt+CR1dPRgJxnIDKMJk6qFruBPRtA6x8GKC4cREpK6poxbhh5RJvb3pQ90xjj8dbtBq4o1kdqhuU6ouw9E=
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
token:
secure: BHW5STgVI32vDYV8lzZRlubDhQqlfAuD9U5a7netgdJwsDraQNOxwNpJXwVwsFTr2qnasYld3zHnm6lSMBTZAO/pqOdz0INp9hYWia8XyW0ebRChummjRoJsuC5GrNQQAY5ibYVwQfiIaf9JkNQRYGkvgICHuaRE9ErSIf83Zp5X/IJzrLWftznl50bFSbY4W3iH9SdXIlGGeX6vVAzvyR9SOt9OCkn71+Rxh2rb0nYGHVqevvJpFDJG4s6BlFuKmNKQ+9z3aHLriWmkYJG+KYd6rTCGS9d5To8qa2zOOCnvIQjLwkfqvvlklRLMf22cpFig+qjXV53Biq4l4zJ2R7hbrhQr/4IB/QgmsYSn21nqM6JsiZBmjcbupgZMfVNBzKNPlvMinbj34sNKSsmTvY31wOad+bfPTVyd1znlbxE5E0jY+RgmGbqCneYQju4HXWBUnYMmFDACqFU/M+wy1jzTUW0IsljGh9lejgz2Gh8q0pnDcCVRccnYuSJTa7P/VJ8eGYwKsH/Uv5Y/2AS/9hkVW1I40xuL3eahug6KfdkhoKBtzDtr/zaHcGG6a/cSYMy+bg84JKKC9zRz+heaihR2ITEpVWIRBujo4A6NDq2IU0db0f3XIYMkh5TZhBmTducqRlVeqA577Pb0m0M/aQW9UKMHR2GSYEa2bwoB/Pw=
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: bash scripts/formula-deploy.sh
on:
tags: true
condition: "$TRAVIS_OS_NAME = osx"