Skip to content

Commit 83bfc5a

Browse files
committed
add appveyor.yml
1 parent 3b1ea05 commit 83bfc5a

File tree

1 file changed

+129
-0
lines changed

1 file changed

+129
-0
lines changed

appveyor.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
version: 0.26.1.{build}
2+
3+
platform:
4+
- x86
5+
- x64
6+
7+
configuration:
8+
- Release
9+
- Light
10+
11+
environment:
12+
GH_TOKEN:
13+
secure: jeReA6BNx/dXVMGfroKadgE9ByKAE/tAGcb2z+dIVZGAN29X1Pu22wi1TuVOy9ZugqBzjvFV4knwHJSGi0+U6Yj1fTfa2CYpeCBym4JOXqPis/GpKfSeBV9IrmJGT/Av
14+
PATH: C:\cygwin\bin;%PATH%
15+
OPENPACE_VER: 1.1.3
16+
ZLIB_VER_DOT: 1.3.1
17+
matrix:
18+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
19+
VCVARSALL: "%ProgramFiles(x86)%/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat"
20+
OPENSSL_VER: "1.1.1"
21+
OPENSSL_DIR: "C:\\OpenSSL-v111"
22+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
23+
VCVARSALL: "%ProgramFiles(x86)%/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvarsall.bat"
24+
OPENSSL_DIR: "C:\\OpenSSL-v30"
25+
OPENSSL_FLAGS: "/DHAVE_EVP_PKEY_DUP"
26+
DO_PUSH_ARTIFACT: yes
27+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
28+
VCVARSALL: "%ProgramFiles%/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvarsall.bat"
29+
OPENSSL_DIR: "C:\\OpenSSL-v30"
30+
OPENSSL_FLAGS: "/DHAVE_EVP_PKEY_DUP"
31+
32+
init:
33+
# Fixes "fatal: detected dubious ownership in repository at '/cygdrive/c/projects/opensc'" with recent images
34+
- git config --global --add safe.directory /cygdrive/c/projects/opensc
35+
36+
install:
37+
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
38+
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
39+
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
40+
throw "There are newer queued builds for this pull request, failing early." }
41+
- ps: $env:PACKAGE_NAME=(git describe --tags --abbrev=0)
42+
- ps: $env:OPENSSL_PF = If ($env:Platform -eq "x86") { "Win32" } Else { "Win64" }
43+
- ps: $env:ARTIFACT="OpenSC-${env:PACKAGE_NAME}_${env:OPENSSL_PF}"
44+
- ps: >-
45+
If ($env:Configuration -Like "*Light*") {
46+
$env:ARTIFACT+="-Light"
47+
} Else {
48+
If (!(Test-Path C:\zlib )) {
49+
appveyor DownloadFile "https://github.com/madler/zlib/archive/v${env:ZLIB_VER_DOT}.zip" -FileName zlib.zip
50+
7z x zlib.zip -oC:\
51+
Rename-Item -path "c:\zlib-${env:ZLIB_VER_DOT}" -newName "zlib"
52+
}
53+
If (!(Test-Path C:\openpace )) {
54+
appveyor DownloadFile "https://github.com/frankmorgner/openpace/archive/${env:OPENPACE_VER}.zip" -FileName openpace.zip
55+
7z x openpace.zip -oC:\
56+
Rename-Item -path "c:\openpace-${env:OPENPACE_VER}" -newName "openpace"
57+
}
58+
}
59+
If (!(Test-Path cpdksetup.exe )) {
60+
appveyor DownloadFile "https://download.microsoft.com/download/1/7/6/176909B0-50F2-4DF3-B29B-830A17EA7E38/CPDK_RELEASE_UPDATE/cpdksetup.exe"
61+
}
62+
- cpdksetup.exe /quiet
63+
- if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" choco install dotnet-sdk --version=6.0.100 -y
64+
- ps: .\.github\setup-wix.ps1
65+
66+
build_script:
67+
- echo "Using %APPVEYOR_BUILD_WORKER_IMAGE% with %VCVARSALL%"
68+
- call "%VCVARSALL%" %Platform%
69+
- ps: >-
70+
if (!($env:Configuration -Like "*Light*")) {
71+
If (!(Test-Path -Path "C:\zlib-${env:OPENSSL_PF}" )) {
72+
# build zlib.lib as a static library
73+
xcopy C:\zlib C:\zlib-${env:OPENSSL_PF} /e /i /y /s
74+
cd C:\zlib-${env:OPENSSL_PF}
75+
(Get-Content win32/Makefile.msc).replace('-MD', '-MT') | Set-Content win32/Makefile.msc
76+
nmake /nologo -f win32/Makefile.msc zlib.lib
77+
}
78+
If (!(Test-Path -Path "C:\openpace-${env:OPENSSL_PF}" )) {
79+
# build libeac.lib as a static library
80+
xcopy C:\openpace C:\openpace-${env:OPENSSL_PF} /e /i /y /s
81+
cd C:\openpace-${env:OPENSSL_PF}\src
82+
cl /nologo /I${env:OPENSSL_DIR}-${env:OPENSSL_PF}\include /I. /DX509DIR=\`"/\`" /DCVCDIR=\`"/\`" /W3 /D_CRT_SECURE_NO_DEPRECATE /DWIN32_LEAN_AND_MEAN /GS /MT /DHAVE_ASN1_STRING_GET0_DATA=1 /DHAVE_DECL_OPENSSL_ZALLOC=1 /DHAVE_DH_GET0_KEY=1 /DHAVE_DH_GET0_PQG=1 /DHAVE_DH_SET0_KEY=1 /DHAVE_DH_SET0_PQG=1 /DHAVE_ECDSA_SIG_GET0=1 /DHAVE_ECDSA_SIG_SET0=1 /DHAVE_EC_KEY_METHOD=1 /DHAVE_RSA_GET0_KEY=1 /DHAVE_RSA_SET0_KEY=1 /DHAVE_EC_POINT_GET_AFFINE_COORDINATES=1 /DHAVE_EC_POINT_SET_AFFINE_COORDINATES=1 ${env:OPENSSL_FLAGS} /c ca_lib.c cv_cert.c cvc_lookup.c x509_lookup.c eac_asn1.c eac.c eac_ca.c eac_dh.c eac_ecdh.c eac_kdf.c eac_lib.c eac_print.c eac_util.c misc.c pace.c pace_lib.c pace_mappings.c ri.c ri_lib.c ta.c ta_lib.c objects.c ssl_compat.c
83+
lib /nologo /out:libeac.lib ca_lib.obj cv_cert.obj cvc_lookup.obj x509_lookup.obj eac_asn1.obj eac.obj eac_ca.obj eac_dh.obj eac_ecdh.obj eac_kdf.obj eac_lib.obj eac_print.obj eac_util.obj misc.obj pace.obj pace_lib.obj pace_mappings.obj ri.obj ri_lib.obj ta.obj ta_lib.obj objects.obj ssl_compat.obj
84+
cd ${env:APPVEYOR_BUILD_FOLDER}
85+
}
86+
$env:ZLIBSTATIC_DEF="/DENABLE_ZLIB_STATIC"
87+
$env:ZLIB_INCL_DIR="/IC:\zlib-${env:OPENSSL_PF}"
88+
$env:ZLIB_LIB="C:\zlib-${env:OPENSSL_PF}\zlib.lib"
89+
$env:OPENSSL_DEF="/DENABLE_OPENSSL"
90+
$env:OPENSSL_DIR="${env:OPENSSL_DIR}-${env:OPENSSL_PF}"
91+
$env:OPENSSL_EXTRA_CFLAGS="/DOPENSSL_SECURE_MALLOC_SIZE=65536"
92+
$env:OPENPACE_DEF="/DENABLE_OPENPACE"
93+
$env:OPENPACE_DIR="C:\openpace-${env:OPENSSL_PF}"
94+
}
95+
- bash -c "exec 0</dev/null && if [ \"$APPVEYOR_REPO_BRANCH\" == \"master\" -a -z \"$APPVEYOR_PULL_REQUEST_NUMBER\" ]; then ./bootstrap; fi"
96+
- bash -c "exec 0</dev/null && if [ \"$APPVEYOR_REPO_BRANCH\" == \"master\" -a -n \"$APPVEYOR_PULL_REQUEST_NUMBER\" ]; then ./bootstrap.ci -s \"-pr$APPVEYOR_PULL_REQUEST_NUMBER\"; fi"
97+
- bash -c "exec 0</dev/null && if [ \"$APPVEYOR_REPO_BRANCH\" != \"master\" -a -z \"$APPVEYOR_PULL_REQUEST_NUMBER\" ]; then ./bootstrap.ci -s \"-$APPVEYOR_REPO_BRANCH\"; fi"
98+
- bash -c "exec 0</dev/null && if [ \"$APPVEYOR_REPO_BRANCH\" != \"master\" -a -n \"$APPVEYOR_PULL_REQUEST_NUMBER\" ]; then ./bootstrap.ci -s \"-$APPVEYOR_REPO_BRANCH-prAPPVEYOR_PULL_REQUEST_NUMBER\"; fi"
99+
# disable features to speed up the script
100+
- bash -c "exec 0</dev/null && ./configure --with-cygwin-native --disable-openssl --disable-readline --disable-zlib || cat config.log"
101+
- nmake /nologo /f Makefile.mak opensc.msi
102+
- move win32\OpenSC.msi %ARTIFACT%.msi
103+
# put all pdb files for dump analysis, but this consumes approx 100 MB per build
104+
- md %ARTIFACT%-Debug
105+
- ps: >-
106+
Get-ChildItem -recurse ${env:APPVEYOR_BUILD_FOLDER} -exclude vc*.pdb *.pdb | % {
107+
7z a -tzip ${env:ARTIFACT}-Debug.zip $_.FullName
108+
}
109+
- appveyor PushArtifact %ARTIFACT%.msi
110+
- appveyor PushArtifact %ARTIFACT%-Debug.zip
111+
# keep in sync with .travis.yml
112+
- bash -c "git config --global user.email 'no-reply@appveyor.com'"
113+
- bash -c "git config --global user.name 'AppVeyor'"
114+
- bash -c "if [ \"$DO_PUSH_ARTIFACT\" = yes -a -z \"$APPVEYOR_PULL_REQUEST_NUMBER\" -a \"$APPVEYOR_REPO_NAME\" = \"OpenSC/OpenSC\" ]; then .github/push_artifacts.sh \"AppVeyor build ${APPVEYOR_BUILD_NUMBER}.${APPVEYOR_JOB_NUMBER}\"; fi"
115+
116+
deploy:
117+
- provider: Webhook
118+
url: https://app.signpath.io/API/v1/8d2463fe-39bd-4a41-bb72-f008b4b1fe17/Integrations/AppVeyor?ProjectSlug=OpenSC&SigningPolicySlug=release-signing&ArtifactConfigurationSlug=initial
119+
authorization:
120+
secure: 73Qvk9MbD7M7ZcoO6NnSH7zDA+9wSKZqNc602b1UeA5v6GsDyEvpCOlzJ9VvBcUuePTKBRsZ+uGQYKsddABgQA==
121+
122+
cache:
123+
- C:\zlib -> .appveyor.yml
124+
- C:\zlib-Win32 -> .appveyor.yml
125+
- C:\zlib-Win64 -> .appveyor.yml
126+
- C:\openpace -> .appveyor.yml
127+
- C:\openpace-Win32 -> .appveyor.yml
128+
- C:\openpace-Win64 -> .appveyor.yml
129+
- cpdksetup.exe -> .appveyor.yml

0 commit comments

Comments
 (0)