-
Notifications
You must be signed in to change notification settings - Fork 3
/
appveyor.yml
93 lines (80 loc) · 2.83 KB
/
appveyor.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
version: '{branch}.{build}'
image:
- Visual Studio 2017
clone_folder: c:\gopath\src\github.com\adedayo\tcpscan
environment:
global:
CC: gcc.exe
MYAPP: tcpscan
VERSION: ${APPVEYOR_REPO_TAG_NAME}
GOARCH: amd64
ARCH: x86_64
matrix:
- platform: x64
configuration: Release
GETH_ARCH: amd64
MSYS2_ARCH: x86_64
# MSYS2_BITS: 64
MSYSTEM: MINGW64
PATH: C:\msys64\mingw64\bin\;C:\msys64\;C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\;C:\Program Files (x86)\NSIS\;%PATH% #make gcc available
stack: go 1.11
platform: x64
install:
- gcc --version
# - set PATH=%WIX%\bin;%PATH% #this is for WiX
- choco install winflexbison -y
- win_flex --version
- win_bison --version
- appveyor DownloadFile https://github.com/the-tcpdump-group/libpcap/archive/libpcap-1.9.0.zip
- dir
- 7z x libpcap-1.9.0.zip
- move libpcap-libpcap-1.9.0 libpcap
- cd libpcap
# - choco install go-msi -y
# - appveyor DownloadFile http://www.winpcap.org/install/bin/WpdPack_4_1_2.zip
# - 7z x .\WpdPack_4_1_2.zip -oWin32
# - cd ..
# - cmake .
build_script:
- type NUL >.devel
- md build
- cd build
# - cmake -DCMAKE_PREFIX_PATH=..\Win32\WpdPack -G"Visual Studio 12 2013" ..
# - msbuild -nologo pcap.sln
- cmake -DCMAKE_AR=ar.exe -DCMAKE_C_COMPILER=gcc.exe -DCMAKE_CXX_COMPILER=g++.exe -DCMAKE_MAKE_PROGRAM=make.exe -DCMAKE_PREFIX_PATH=..\libpcap -G"MSYS Makefiles" ..
- msbuild /m /nologo /p:Configuration=Release pcap.sln
# copy file to where cgo is expecting them to be, see https://github.com/google/gopacket/blob/c5b434497bea7a3417dc45b84c70282c4a5b3b3d/pcap/pcap.go
- echo f | xcopy Release\pcap.exp C:\WpdPack\Lib\x64\wpcap.exp
- echo f | xcopy Release\pcap.lib C:\WpdPack\Lib\x64\wpcap.lib
- echo f | xcopy Release\pcap_static.lib C:\WpdPack\Lib\x64\wpcap_static.lib
- echo d | xcopy ..\pcap C:\WpdPack\Include
- echo d | xcopy ..\pcap C:\WpdPack\Include\pcap # some files are expecting the headers under pcap directory
- cd ..
- go get ./...
- set BUILDFLAGS=-a -v -x -ldflags '-v -extldflags "-static"' #attempt to set static linker
- go build %BUILDFLAGS% github.com\adedayo\tcpscan\cmd\tcpscan
- dir
# - set PATH=C:\Program Files\go-msi\;%PATH% #go-msi path
# - go-msi make --msi tcpscan-%VERSION%-%GOARCH%.msi --version %VERSION% --arch %GOARCH%
- 7z a %MYAPP%-%VERSION%-Windows-%ARCH%.zip *.exe
- dir
artifacts:
- path: libpcap\tcpscan*.zip
name: zip-x64
deploy:
- provider: GitHub
artifact: zip-x64
draft: false
prerelease: false
description: "Release ${VERSION}"
auth_token:
secure: WdtmPBg+FpFzcaV8TifOOP6BvkGo1OpvRAfWZv3aZJjVD5PdE/xLrMd8zhrnAxzc
on:
APPVEYOR_REPO_TAG: true
# before_build:
# - go get ./...
# - go build github.com\adedayo\tcpscan\cmd\tcpscan
# before_test:
# - go vet ./...
# test_script:
# - go test ./...