forked from bettercap/bettercap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
158 lines (145 loc) · 4.67 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Globals
language: go
go:
- 1.16.x
env:
global:
- VERSION=$(echo ${TRAVIS_BRANCH} | sed "s/\//_/g")
- OUTPUT="bettercap"
cache:
apt: true
# Includes
linux_deps: &linux_deps
os: linux
dist: bionic
addons:
apt:
packages:
- p7zip-full
- libpcap-dev
- libnetfilter-queue-dev
- libusb-1.0-0-dev
update: true
finish: &finish
after_success:
- file "${OUTPUT}"
- openssl dgst -sha256 "${OUTPUT}" | tee bettercap_${TARGET_OS}_${TARGET_ARCH}_${VERSION}.sha256
- 7z a "bettercap_${TARGET_OS}_${TARGET_ARCH}_${VERSION}.zip" "${OUTPUT}" "bettercap_${TARGET_OS}_${TARGET_ARCH}_${VERSION}.sha256"
- ls -la bettercap*
cross_deps: &cross_deps
<<: *linux_deps
before_install:
- wget --show-progress -qcO "qemu.deb" "https://debian.grena.ge/debian/pool/main/q/qemu/qemu-user-static_5.2+dfsg-6+b1_amd64.deb"
- sudo dpkg -i "qemu.deb"
normal_install: &normal_install
install:
- make -e TARGET="${OUTPUT}"
<<: *finish
cross_install: &cross_install
install:
- sudo builder/arm_builder.sh bettercap make -e TARGET="${OUTPUT}"
<<: *finish
# Tasks
matrix:
include:
- name: Linux - amd64
if: tag IS present
arch: amd64
env:
- TARGET_OS=linux
- TARGET_ARCH=amd64
<<: *linux_deps
<<: *normal_install
- name: Linux - aarch64
if: tag IS present
arch: arm64
env:
- TARGET_OS=linux
- TARGET_ARCH=aarch64
- GEM_HOME=~/.ruby
- PATH=$PATH:~/.ruby/bin
<<: *linux_deps
<<: *normal_install
before_install:
- mkdir -p ~/.ruby
- name: Linux - armhf
if: tag IS present
language: minimal
arch: amd64
env:
- TARGET_OS=linux
- TARGET_ARCH=armhf
<<: *cross_deps
<<: *cross_install
- name: OSX - amd64
if: tag IS present
os: osx
arch: amd64
addons:
homebrew:
packages:
- libpcap
- libusb
- p7zip
update: true
env:
- TARGET_OS=darwin
- TARGET_ARCH=amd64
- PATH="/usr/local/opt/libpcap/bin:$PATH"
- LDFLAGS="-L/usr/local/opt/libpcap/lib $LDFLAGS"
- CPPFLAGS="-I/usr/local/opt/libpcap/include $CPPFLAGS"
- PKG_CONFIG_PATH="/usr/local/opt/libpcap/lib/pkgconfig:$PKG_CONFIG_PATH"
<<: *normal_install
- name: Windows - amd64
if: tag IS present
os: windows
arch: amd64
env:
- TARGET_OS=windows
- TARGET_ARCH=amd64
- PKG_CONFIG_PATH="c:/pkg-config"
- OUTPUT=bettercap.exe
- CGO_CFLAGS="-I/c/winpcap/WpdPack/Include -I/c/libusb/include/libusb-1.0"
- CGO_LDFLAGS="-L/c/winpcap/WpdPack/Lib/x64 -L/c/libusb/MinGW64/static"
before_install:
- choco install openssl.light -y
- choco install make -y
- choco install 7zip -y
- choco install pkgconfiglite -y
- mkdir /c/pkg-config
- choco install zadig -y
- curl -L "https://github.com/libusb/libusb/releases/download/v1.0.24/libusb-1.0.24.7z" -o "/c/libusb.7z"
- 7z x -y "/c/libusb.7z" -o"/c/libusb"
- cp builder/libusb.pc /c/pkg-config/libusb.pc
- cp builder/libusb.pc /c/pkg-config/libusb-1.0.pc
- choco install winpcap -y
- curl -L "https://www.winpcap.org/install/bin/WpdPack_4_1_2.zip" -o "c:/wpcap-sdk.zip"
- 7z x -y "/c/wpcap-sdk.zip" -o"/c/winpcap"
<<: *normal_install
- name: Linux - tests
if: tag IS blank
os: linux
arch: amd64
allow_failures:
- go: master
fast_finish: true
<<: *linux_deps
script:
- env GO111MODULE=on make test
after_success:
- base <(curl -s https://codecov.io/bash)
deploy:
provider: releases
api_key:
secure: gaQDeYOe/8lL3++jok73kSNtJVyj5Dk8RdxerjSa3hsVrL5IljsNsGGXocesCQ4ubFrnOO26RmO1FxMKmqYBpewRwQ6GKqZjc7IbwR9Cy0c0AyRRULnCsXue3NxIQBobqAwKtaaqDPHZcX1eOVgDnrheMpT5nt9YN2Xyv9zdFAmjfhUxv8K3nyv9eOMHYy0TmcKanQSXcYTHnUONt4Af5XA2NZGTtLUB+FAEf93vLqyqmmkX0EJciYu3HSZmCPFLLACi1WDSvt+e4TlozrutMpgm3JNzZ3eg6IsesRzxy/s2HeOnVJLMCadGjqap98xfSY6V00cUdCny+n8xfDgCzMljM0bEMDUhIs97AFdLXJZKPRGrNSmnurIcJ+NaVrFS5BMiLwQ2J6WiRvDaCWROVd+Vml/bWWZIUsMxVapEN5vbtw8R/gSVQyZnZUXLrArIBQxenSFlMcWDi+VMF38GrQgAB/ddlMZqWjVubpWOSN45Eity0SsLAgsAuNjH1YCeCr0zj1sG08NPsnTPSKr+661iuOTpsdgu/4crF6qcFcl/kvJsw6tyFPVLO5yzbX9q4O778vXRduzPuBeD63eFuHD8pwceGxWWxN9vnQtX6OqRKmEsrLP7aL9dkI2zgp7TOj058hNQefQ5FD25yfKNCUfp/tnxa6XrkrPzWq/SX7c=
skip_cleanup: true
file_glob: true
file:
- bettercap_*.zip
- bettercap_*.sha256
on:
tags: true
repo: bettercap/bettercap
branches:
only:
- "/^v[0-9]+\\.[0-9]+\\.[0-9]+[A-Za-z0-9]+?$/"