-
Notifications
You must be signed in to change notification settings - Fork 126
/
appveyor.yml
173 lines (146 loc) · 9.64 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
image: Visual Studio 2019
environment:
nodejs_version: "14.15.0"
BUILD_OS: "windows"
priv_key:
secure: 42UGuNZCj/s6VpD6dT98+57adzug9ri6kOQO6lqbm5M4v5tPPZ4B0MBnnq/Ose+G1ZwE4a/+NT9OOFGyW+Lr6wUimB8SI5xbUoih3GI+pbwh8oXS9ESaJnfC1aN62YvsmOue982gL730oIhspAiHTxSzVenwxUp4FfpvMRe1LDZJ4V6ck3VaDo/45geLsz9gKreV7qdncBztsgvqe/SJ9+vGIzRAUGKT0tKnoTxJSEMT3Y1cYDCDqWzbym9IKqYMO07DtEfHn6K/VpIZ8scR9w0gRXtLH9CJxAxFKmEidOmNHFtkc7DUFJ9qMMFsl0DicuU81ZkwSiXo5dxoXgLOwyuffXlclLAcPLpyG7Kl7TGAjVFQ6p8xCmf/c3EggFVyivOiz2CXE/Y5JVUATGykhGxLy8wA+v3vkoMVpJmBoZWCAEG5ojGqS0VfbOTtBZbA/hyGb/eYHBER9RRgdjHPN5SUQP/aE7/9T7uUj7UgKgqkMQ5jsWVIf2rvIqfV9nhUkZIzC0i3UXlRUnyOXCdmxEO5CAbuNnjVPWqcM+ke6DaFezRsZy455eNOhziVjOe5ePXz021Aq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dLj/Hun+8KNM4A0k7Vo6VQQ/6re8gkGIIl+5601UOw/Fe5BXbP/JlWdNLCR/4vXugikqVHs7BzZO5PJoZz/Dl/Ksy2c/Brkm+0kiYkgfP4qd/DRbF2f0IdOrLtXsTg83jxec3aUqNT8T0cn/rtZxlgJst4CgVIN7Kx0kH6cjzLQiRVAIqMLbKmn9YAeE76CcM/wrQR8QpowxFt2FUunnV5kI2rDEXsrtUEerQd2+B7fVtVitfCXMVmnclbMZ7t3KowzQFahUlFYDHmgOoKYjCFNkmxfr77lJklpQ47yIUaK+4KY/MSTaAn+usOPfxx3rd+lDr4HHSVr3vZWsKxgxWIkJutKkDqhwMeU+psZt17Xw/rV3Na9Y+p1GDA7u2fpLwtNzl5JdP027j2Ye7PVh4AO8L5HBfxwDFUO5zqmCBl2vleFKQJ/eSz+oq9ZlXNihWxYxkovTZVy22hOy398smMnLXow9kAq/lANLaCjgbcg2aw/g6G8XIQ0O82R4DGXcIQ/NOCljZO7T+
CERT_PASS:
secure: /xvbtkYwje7dQ5iO0s3neA==
compiler: msvc2019
aws_key: AKIAJWBFLU34IVITPLHA
aws_secret:
secure: X/MRT0y7Yb8tnzdcQ8Lq+A+/Yc5Ad2KWFYpaydFz0zDSaq8PxZ8XbFseDxjKYo6c
DEPLOY: true
init:
# Prevent pull requests from attempting to sign package.
- if NOT "%APPVEYOR_PULL_REQUEST_NUMBER%" == "" set DEPLOY=false
install:
- git submodule update --init --recursive
# Install OpenSSL
- ps: |
$opensslHashesUrl = 'https://raw.githubusercontent.com/slproweb/opensslhashes/master/win32_openssl_hashes.json'
$files = (Invoke-RestMethod $opensslHashesUrl).files
$file = $files.psobject.properties.name | ? { $_.StartsWith('Win32OpenSSL-1_1_1') -and $_.EndsWith('.exe') } | select -First 1
Start-FileDownload $files.$file.url
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $files.$file.sha256) { throw "The checksum does not match" }
Start-Process $file -ArgumentList '/silent /verysilent /sp- /suppressmsgboxes /dir=C:\OpenSSL-Win32' -Wait
del $file
- set OPENSSL_BIN_PATH=C:\OpenSSL-Win32\bin
# Download rcedit
- ps: Start-FileDownload "https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x86.exe"
# Temp debugging
- ps: $env:DLL_DIR = "windows"
- echo DLL_DIR %DLL_DIR%
# All the *_BIN_PATH variables are used by the gulp deploy-windows task to generate the installer exe
- set MPV_BIN_PATH=%DLL_DIR%
# For DS.exe
- set DS_BIN_PATH=%DLL_DIR%\DS
# For VCRedist
- if %compiler%==msvc2019 set VCREDIST_BIN_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.16.27012\x86\Microsoft.VC141.CRT
- if %compiler%==msvc2019_64 set VCREDIST_BIN_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.16.27012\x64\Microsoft.VC141.CRT
- set QTDIR=C:\Qt\5.15.2\msvc2019
- set VSCDIR=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
- set NSISDIR=C:\Program Files (x86)\NSIS
- set PATH=%PATH%;%QTDIR%\bin;%VSCDIR%\bin;%NSISDIR%
# Install NsProcess NSIS Plugin
- move windows\NsProcess\Include\nsProcess.nsh "%NSISDIR%\Include"
- move windows\NsProcess\Plugin\x86-ansi\nsProcess.dll "%NSISDIR%\Plugins\x86-ansi"
- move windows\NsProcess\Plugin\x86-unicode\nsProcess.dll "%NSISDIR%\Plugins\x86-unicode"
# Prepare the environment by installing Node and setting VC utils in the PATH
- ps: Install-Product node $env:nodejs_version x86
- CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat"
# Unfortunately AppVeyor expects that to be a Visual Studio/C#/whatever project, so we cannot define custom build steps; instead, use test_script step
build: off
test_script:
- ps: $env:UPLOAD_PATH = If ($env:TAG) { $env:TAG } else { If ($env:APPVEYOR_REPO_TAG_NAME) { $env:APPVEYOR_REPO_TAG_NAME } else { $env:APPVEYOR_REPO_BRANCH } }
- ps: $env:TAG = If (!$env:TAG) { "master" } else { $env:TAG }
- ps: $env:package_version = (Select-String -Path .\CMakeLists.txt -Pattern '^project\(stremio VERSION "([^"]+)"\)').Matches.Groups[1].Value
# Pull pre-built resources from S3; those were generated by the travis build for "stremio"
#- ps: $env:TAG = If (!$env:TAG) { $(git describe --abbrev=0 --tags) } else { $env:TAG }
# Use "master" as a tag for nightly builds (will take latest built server.js/stremio.asar)
- ps: echo "> building from TAG $env:TAG, version $env:package_version"
- ps: Add-AppveyorMessage "building from TAG $env:TAG, version $env:package_version"
- ps: echo "> building shell"
# Manually add a path to RC.exe
- set PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86\;%PATH%
- ps: |
mkdir release
pushd release
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
popd
- mkdir dist-win
# copy-windows-openssl
- copy "%OPENSSL_BIN_PATH%\*.dll" dist-win
# copy ffmpeg and ffprobe
- move "%DLL_DIR%\*.exe" dist-win
# copy MPV and ffmpeg DLLs
- copy "%DLL_DIR%\*.dll" dist-win
# copy-windows-node (stremio-runtime)
- ps: '& $(Join-Path $env:DLL_DIR "generate_stremio-runtime.cmd") dist-win'
# Download server.js in order to work with node 14
- ps: Start-FileDownload (Get-Content -path ./server-url.txt) -FileName .\dist-win\server.js
# copy-windows-ds
- copy "%DS_BIN_PATH%\DS.exe" dist-win
- copy "%DS_BIN_PATH%\Microsoft.Search.Interop.dll" dist-win
# copy-windows-vcredist
- copy "%VCREDIST_BIN_PATH%\msvcp140.dll" dist-win
- copy "%VCREDIST_BIN_PATH%\msvcp140_1.dll" dist-win
- copy "%VCREDIST_BIN_PATH%\vccorlib140.dll" dist-win
- copy "%VCREDIST_BIN_PATH%\vcruntime140.dll" dist-win
# copy-windows-qtshell
- ps: cp release\*.dll dist-win
- ps: cp release\*.exe dist-win
# Very basic integration test
- ps: $serverProc = Start-Process "$env:COMSPEC" "/c dist-win\stremio-runtime.exe dist-win\server.js > server-log.txt 2>&1" -PassThru
- ps: Start-Sleep 8
- ps: Try { $serverStatusCode = wget 127.0.0.1:11470/stats.json | % {$_.StatusCode} } Catch { cat server-log.txt; Throw $_ }
- ps: if ($serverStatusCode -ne 200) { throw 'stremio server is not reachable' }
- ps: Stop-Process $serverProc.Id
- ps: taskkill /f /im stremio-runtime.exe
- ps: echo "> server status code was $serverStatusCode"
- ps: $mpvExists = Test-Path $env:MPV_BIN_PATH\mpv-1.dll
- ps: if (!$mpvExists) { throw 'mpv-1.dll does not exist' }
# prepare-windows-qt
- windeployqt --release --no-compiler-runtime --qmldir=. ./dist-win/stremio.exe
# sign-windows-files
- if "%DEPLOY%" == "true" SignTool sign /f ./windows/smartcode-20211118-20241118.pfx /p %CERT_PASS% ./dist-win/stremio.exe
- if "%DEPLOY%" == "true" SignTool sign /f ./windows/smartcode-20211118-20241118.pfx /p %CERT_PASS% ./dist-win/stremio-runtime.exe
- if "%DEPLOY%" == "true" SignTool sign /f ./windows/smartcode-20211118-20241118.pfx /p %CERT_PASS% ./dist-win/ffmpeg.exe
- if "%DEPLOY%" == "true" SignTool sign /f ./windows/smartcode-20211118-20241118.pfx /p %CERT_PASS% ./dist-win/ffprobe.exe
# build-windows-installer
- makensis -V2 ./windows/installer/windows-installer.nsi
- if "%DEPLOY%" == "true" SignTool sign /f ./windows/smartcode-20211118-20241118.pfx /p %CERT_PASS% *.exe
# TODO: test if stremio.exe starts properly; because the missing DLLs errors are handled at run-time, we cannot catch them sanely
# we can mix that with the server integration test, then we'd be able to detect some sanity
#- ps: echo "> simple integration test"
#- ps: $stremioProc = Start-Process dist-win\stremio.exe -PassThru
# Deploy artifacts to S3
artifacts:
- path: "*.exe"
deploy:
provider: S3
access_key_id: $(aws_key)
secret_access_key: $(aws_secret)
bucket: stremio-artifacts
region: eu-west-1
set_public: true
folder: shell-win/$(UPLOAD_PATH)
max_error_retry: 1
on:
DEPLOY: true
# We need to customize the Slack notification so we add messages and links to artifacts
notifications:
- provider: Slack
incoming_webhook:
secure: HNo1varKvdvTmpqsgnGBU7PZYelljYby4YUir+R/4T5uPnOoPMxSKIDjF9BJTX6SQ7H6N6CUl5nmJYDy+3WfyfqEBqwEugAdPFoThMwZseo=
template: |
<{{buildUrl}}|Build {{projectName}} {{buildVersion}} {{status}}> for {{duration}}
_Commit <{{commitUrl}}|{{commitId}}> by {{commitAuthor}} on {{commitDate}}: {{commitMessage}}_
{{#jobs}}
{{#messages}}*{{message}}*{{/messages}}
{{#artifacts}}<{{url}}|Download {{fileName}}>{{/artifacts}}
{{/jobs}}
# Speeds up the build a bit
cache:
- "%LOCALAPPDATA%\\Yarn"