-
Notifications
You must be signed in to change notification settings - Fork 15
79 lines (61 loc) · 2.07 KB
/
Copy pathbuild.yml
File metadata and controls
79 lines (61 loc) · 2.07 KB
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
name: Publish
on:
push:
tags:
- '*'
jobs:
build:
name: Build binary
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Install libpcap
run: sudo apt install -y libpcap-dev --install-suggests
- name: Get dependencies
run: go get -v
working-directory: "."
- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Check for vulnerabilities
run: govulncheck ./...
- name: Build
run: go build -ldflags="-X 'gopherCap/cmd.Version=${{ github.ref_name }}'" -o gopherCap .
working-directory: "."
- name: Execute binary for testing
run: ./gopherCap --help
working-directory: "."
- name: Compress the binary
run: gzip gopherCap
working-directory: "."
- uses: actions/upload-artifact@v2
with:
name: gopherCap.gz
path: ./gopherCap.gz
- name: Upload Linux binary to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./gopherCap.gz
asset_name: gopherCap.gz
tag: ${{ github.ref }}
overwrite: true
body: |
## Install
Simply decompress the binary and make it executable. All documentation can be found using `--help`.
* Ensure that **libpcap** is installed;
* Requires amd64 platform, we do not provide arm builds because we build against libpcap;
* Only tested on recent ubuntu / debian, binary will likely crash on rolling-release distros such as arch or fedora because build is linked to `libc` and `libpcap`;
```
gunzip gopherCap.gz
chmod u+x gopherCap
./gopherCap --help
```
Full configuration dictionary can be generated with `exampleConfig` command.
```
./gopherCap --config example.yml exampleConfig
```