forked from aircrack-ng/aircrack-ng
-
Notifications
You must be signed in to change notification settings - Fork 1
/
appveyor.yml
189 lines (165 loc) · 8.21 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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
version: 1.0.{build}
pull_requests:
do_not_increment_build_number: true
# Do not build feature branch with open Pull Requests
skip_branch_with_pr: true
image: Visual Studio 2017
configuration: Release
platform: x64
clone_depth: 500
environment:
global:
APPVEYOR_SAVE_CACHE_ON_ERROR: true
AIRCRACK_CI_CACHE: C:\aircrack_ci_cache
CYG_CACHE: '%AIRCRACK_CI_CACHE%\cygwin'
MSYS2_CACHE: '%AIRCRACK_CI_CACHE%\msys2'
CHERE_INVOKING: 1
MSYSTEM: MSYS
matrix:
- TARGET: cygwin
COMPILER: gcc
- TARGET: cygwin64
COMPILER: gcc
- TARGET: cygwin
COMPILER: clang
- TARGET: cygwin64
COMPILER: clang
# - TARGET: msys64
- TARGET: pkg
matrix:
fast_finish: true
allow_failures:
- TARGET: cygwin
COMPILER: clang
- TARGET: cygwin64
COMPILER: clang
# - TARGET: msys64
cache:
- 'c:\cygwin\home'
- 'c:\cygwin64\home'
- 'c:\msys64\home'
# - '%AIRCRACK_CI_CACHE%'
# Uncomment to enable debugging on AppVeyor equipment
#
init:
- git config --global core.autocrlf input
- git config --global core.eol lf
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
install:
- ps: |
function Exec-External {
param(
[Parameter(Position=0,Mandatory=1)][scriptblock] $command
)
& $command 2>&1 | %{ "$_" }
if ($LASTEXITCODE -ne 0) {
throw ("Command returned non-zero error-code ${LASTEXITCODE}: $command")
}
}
- ps: |
function downloadIfOlderThanDays($url, $path, $days) {
if ( !(Test-Path $path -NewerThan (Get-Date).AddDays(-$days)) ) {
Write-Host "$path does not exist or is older than $days days, downloading from $url"
Invoke-WebRequest $url -OutFile $path
}
}
- ps: |
function updateCygwin($cygwinexe, $installFolder, $cacheFolder) {
Write-Host "Update Cygwin: $cygwinexe"
Exec-External {& cmd /c $cygwinexe -gqnNdO -R $installFolder -s http://mirrors.kernel.org/sourceware/cygwin/ -l $cacheFolder -P autoconf -P automake -P bison -P clang -P gcc-core -P gcc-g++ -P mingw-runtime -P mingw-binutils -P mingw-gcc-core -P mingw-gcc-g++ -P mingw-pthreads -P mingw-w32api -P libtool -P make -P python -P gettext-devel -P gettext -P intltool -P libiconv -P libiconv-devel -P pkg-config -P git -P wget -P curl -P libcurl4 -P libpcre-devel -P libssl-devel -P libsqlite3-devel -P zlib-devel -P cmocka -P unzip -P zip -P rsync -P expect -P libhwloc-devel -P ccache}
Write-Host "Update Cygwin: $cygwinexe " -NoNewLine
Write-Host "[ OK ]" -ForegroundColor Green
}
- ps: |
if ($env:TARGET -eq "cygwin" -or $env:TARGET -eq "pkg") {
New-Item -Force -Type Directory $env:CYG_CACHE
downloadIfOlderThanDays "https://cygwin.com/setup-x86.exe" "${env:AIRCRACK_CI_CACHE}\setup-x86.exe" 7
updateCygwin "${env:AIRCRACK_CI_CACHE}\setup-x86.exe" C:/cygwin $env:CYG_CACHE
}
- ps: |
if ($env:TARGET -eq "cygwin64" -or $env:TARGET -eq "pkg") {
New-Item -Force -Type Directory $env:CYG_CACHE
downloadIfOlderThanDays "https://cygwin.com/setup-x86_64.exe" "${env:AIRCRACK_CI_CACHE}\setup-x86_64.exe" 7
updateCygwin "${env:AIRCRACK_CI_CACHE}\setup-x86_64.exe" C:/cygwin64 $env:CYG_CACHE
}
- ps: |
if ($env:TARGET -eq "msys64") {
function bash($bash_command) {
Write-Host "MSYS2-Bash: $bash_command"
Exec-External {& C:\msys64\usr\bin\bash.exe --login -e -c $bash_command }
Write-Host "MSYS2-Bash $bash_command " -NoNewLine
Write-Host "[ OK ]" -ForegroundColor Green
}
New-Item -Force -Type Directory $env:MSYS2_CACHE
$unix_msys2_cache = (Exec-External {& C:\msys64\usr\bin\bash.exe --login -e -c "cygpath '${env:MSYS2_CACHE}'"})
# install latest pacman
bash "pacman -Sy --noconfirm --cache `"$unix_msys2_cache`" pacman pacman-mirrors"
# update core packages
bash "pacman -Syu --noconfirm --cache `"$unix_msys2_cache`""
# install Aircrack-ng build dependencies
bash "pacman --sync --noconfirm --cache `"$unix_msys2_cache`" autoconf automake1.15 libtool msys2-w32api-headers msys2-w32api-runtime pkg-config git python openssl-devel openssl libopenssl msys2-runtime-devel binutils make pcre-devel libsqlite-devel zlib-devel ccache"
}
build_script:
- cmd: |
C:\cygwin\bin\bash -e -l -c "curl -RLO https://dl.aircrack-ng.org/AirPcap_Devpack_4_1_1_1838.zip"
- ps: |
$hashFromFile = Get-FileHash -Path "AirPcap_Devpack_4_1_1_1838.zip" -Algorithm SHA256
if ($hashFromFile.Hash -ne "86dcde46603cd1229245263499ef9cb4e43ee66cd7219605d30095562888da14") {
Write-Host "AirPcap failed digest check." -ForegroundColor Red
$hashFromFile | Format-List
Break
}
- cmd: |
C:\cygwin\bin\bash -e -l -c "7z -y x AirPcap_Devpack_4_1_1_1838.zip"
- ps: |
if ($env:TARGET -eq "cygwin") {
Exec-External {& C:\cygwin\bin\bash -e -l -c "cp -vfp Airpcap_Devpack/bin/x86/airpcap.dll /cygdrive/c/Windows/System32"}
Exec-External {& C:\cygwin\bin\bash -e -l -c "dlltool -D Airpcap_Devpack/bin/x86/airpcap.dll -d build/airpcap.dll.def -l Airpcap_Devpack/bin/x86/libairpcap.dll.a"}
if ($env:COMPILER -eq "gcc") {
Exec-External {& C:\cygwin\bin\bash -e -l -c "./build/cygwin.sh gcc --enable-maintainer-mode --with-experimental --with-airpcap=/cygdrive/c/projects/aircrack-ng"}
Exec-External {& C:\cygwin\bin\bash -e -l -c "./build/cygwin.sh gcc --enable-maintainer-mode --with-experimental"}
} else {
Exec-External {& C:\cygwin\bin\bash -e -l -c "./build/cygwin.sh clang --enable-maintainer-mode --with-experimental --with-airpcap=/cygdrive/c/projects/aircrack-ng"}
}
}
- ps: |
if ($env:TARGET -eq "cygwin64") {
Exec-External {& C:\cygwin64\bin\bash -e -l -c "cp -vfp Airpcap_Devpack/bin/x64/airpcap.dll /cygdrive/c/Windows/System"}
Exec-External {& C:\cygwin64\bin\bash -e -l -c "dlltool -D Airpcap_Devpack/bin/x64/airpcap.dll -d build/airpcap.dll.def -l Airpcap_Devpack/bin/x64/libairpcap.dll.a"}
if ($env:COMPILER -eq "gcc") {
Exec-External {& C:\cygwin64\bin\bash -e -l -c "./build/cygwin.sh gcc --enable-maintainer-mode --with-experimental --with-airpcap=/cygdrive/c/projects/aircrack-ng"}
Exec-External {& C:\cygwin64\bin\bash -e -l -c "./build/cygwin.sh gcc --enable-maintainer-mode --with-experimental"}
} else {
Exec-External {& C:\cygwin64\bin\bash -e -l -c "./build/cygwin.sh clang --enable-maintainer-mode --with-experimental --with-airpcap=/cygdrive/c/projects/aircrack-ng"}
}
}
- ps: |
if ($env:TARGET -eq "msys64") {
Exec-External {& C:\msys64\usr\bin\bash -e -l -c "cp -vfp Airpcap_Devpack/bin/x64/airpcap.dll /c/Windows/System"}
Exec-External {& C:\msys64\usr\bin\bash -e -l -c "dlltool -D Airpcap_Devpack/bin/x64/airpcap.dll -d build/airpcap.dll.def -l Airpcap_Devpack/bin/x64/libairpcap.dll.a"}
Exec-External {& C:\msys64\usr\bin\bash -e -l -c "./build/cygwin.sh gcc --enable-maintainer-mode --with-experimental --with-airpcap=/c/projects/aircrack-ng"}
Exec-External {& C:\msys64\usr\bin\bash -e -l -c "./build/cygwin.sh gcc --enable-maintainer-mode --with-experimental"}
}
- ps: |
if ($env:TARGET -eq "pkg" -and -not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
Exec-External {& C:\msys64\usr\bin\bash -e -l -c "cp -vfp Airpcap_Devpack/bin/x64/airpcap.dll /c/Windows/System"}
Exec-External {& C:\msys64\usr\bin\bash -e -l -c "cp -vfp Airpcap_Devpack/bin/x86/airpcap.dll /c/Windows/System32"}
Exec-External {& C:\msys64\usr\bin\bash -e -l -c "dlltool -D Airpcap_Devpack/bin/x64/airpcap.dll -d build/airpcap.dll.def -l Airpcap_Devpack/bin/x64/libairpcap.dll.a"}
Exec-External {& C:\cygwin\bin\bash -e -l -c "dlltool -D Airpcap_Devpack/bin/x86/airpcap.dll -d build/airpcap.dll.def -l Airpcap_Devpack/bin/x86/libairpcap.dll.a"}
.\build\package-win32.ps1 2>&1 | %{ "$_" }
}
artifacts:
- path: 'aircrack-ng-*.zip'
deploy:
- provider: FTP
host: secure.thrallingpenguin.com
protocol: ftp
username: appveyor
password:
secure: TMwjjDnIFGZclF9TbbgBprDa1kRweHrh6Gw4vnDW/QegdmR4CT/LUiDf9L+OdNVZ
folder: artifacts/aircrack-ng/development/$(APPVEYOR_REPO_COMMIT)/win
artifact: /aircrack-ng-.*\.zip/
beta: true
debug: true
on:
branch: master