forked from boy-hack/ksubdomain
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (49 loc) · 1.49 KB
/
test.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
name: 🎉 Build Binary Test
on:
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
steps:
- name: Set up Go 1.17
uses: actions/setup-go@v1
with:
go-version: 1.17
id: go
- name: Set up libpcap-dev
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install libpcap-dev gcc -y
# - name: Set up Darwin libpcap
# if: matrix.os == 'macos-latest'
# run: brew install libpcap
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: go mod download
- name: Build On Linux
run: go build -o ./ksubdomain_${{ runner.os }} ./cmd/
if: matrix.os == 'ubuntu-latest'
env:
GOENABLE: 1
CGO_LDFLAGS: "-Wl,-static -L/usr/lib/x86_64-linux-gnu/libpcap.a -lpcap -Wl,-Bdynamic"
- name: Build On Darwin
run: go build -o ./ksubdomain_${{ runner.os }} ./cmd/
if: matrix.os == 'macos-latest'
- name: Build On Windows
run: go build -o ./ksubdomain_windows.exe ./cmd/
if: matrix.os == 'ubuntu-latest'
env:
GOOS: windows
GOENABLE: 1
- name: Upload a build artifact
uses: actions/upload-artifact@v2
with:
name: ksubdomain_${{ runner.os }}_amd64
path: ksubdomain*
if-no-files-found: error