-
Notifications
You must be signed in to change notification settings - Fork 94
/
azure-pipelines-windows-template.yml
76 lines (72 loc) · 3.7 KB
/
azure-pipelines-windows-template.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
parameters:
name: Windows_x64
architecture: 'x64'
qt_version: '5.15.2'
qt_spec: 'msvc2019_64'
qt_aqt_spec: 'win64_msvc2019_64'
vc_redist_url: 'https://aka.ms/vs/17/release/vc_redist.x64.exe'
vc_redist_file_name: 'vc_redist.x64.exe'
vc_vars: 'vcvars64.bat'
jobs:
- job: ${{ parameters.name }}
timeoutInMinutes: 90
dependsOn: CodeFormatValidation
variables:
- ${{ if and(eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/luisangelsm/'), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))) }}:
- group: windows-codesign
pool:
vmImage: 'windows-2019'
steps:
- script: |
pip install aqtinstall
mkdir C:\Qt
python -m aqt install -O c:\Qt ${{ parameters.qt_version }} windows desktop ${{ parameters.qt_aqt_spec }}
dir C:\Qt\${{ parameters.qt_version }}\${{ parameters.qt_spec }}\bin
choco install -y wget
choco install innosetup
mkdir $(Build.SourcesDirectory)\compressed_archive
wget "https://github.com/YACReader/yacreader-7z-deps/blob/main/7z2301-src.7z?raw=true" -O $(Build.SourcesDirectory)\compressed_archive\7z2301-src.7z
7z x $(Build.SourcesDirectory)\compressed_archive\7z2301-src.7z -o$(Build.SourcesDirectory)\compressed_archive\lib7zip
wget "${{ parameters.vc_redist_url }}" -O $(Build.SourcesDirectory)\${{ parameters.vc_redist_file_name }}
displayName: 'Install dependencies'
- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\${{ parameters.vc_vars }}"
set PATH=C:\Qt\${{ parameters.qt_version }}\${{ parameters.qt_spec }}\bin;%PATH%
set DEFINES_VAR=DEFINES+="BUILD_NUMBER=\\\\\\\"$(Build.BuildNumber)\\\\\\\""
qmake CONFIG+="7zip" %DEFINES_VAR%
nmake
displayName: 'Build'
- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\${{ parameters.vc_vars }}"
set PATH=C:\Qt\${{ parameters.qt_version }}\${{ parameters.qt_spec }}\bin;%PATH%
nmake check TESTARGS="-maxwarnings 100000"
displayName: 'Run tests'
- ${{ if and(eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/luisangelsm/'), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))) }}:
- task: DownloadSecureFile@1
name: pfxFile
displayName: 'Get the pfx file certificate'
inputs:
secureFile: 'certificate.pfx'
- ${{ if and(eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/luisangelsm/'), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))) }}:
- script: |
set PATH=C:\Qt\${{ parameters.qt_version }}\${{ parameters.qt_spec }}\bin;%PATH%
cd $(Build.SourcesDirectory)\ci\win
.\create_installer.cmd ${{ parameters.architecture }} 7z $(Build.BuildNumber) qt5 $(pfxFile.secureFilePath) %PASSWORD%
env:
PASSWORD: $(pfxPassword)
displayName: 'Create installer'
- ${{ else }}:
- script: |
set PATH=C:\Qt\${{ parameters.qt_version }}\${{ parameters.qt_spec }}\bin;%PATH%
cd $(Build.SourcesDirectory)\ci\win
.\create_installer.cmd ${{ parameters.architecture }} 7z $(Build.BuildNumber) qt5
displayName: 'Create installer'
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)\ci\win\Output\
contents: '*'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishPipelineArtifact@1
inputs:
path: $(Build.ArtifactStagingDirectory)
artifactName: Windows ${{ parameters.architecture }} $(Build.BuildNumber) 7z Installer