-
Notifications
You must be signed in to change notification settings - Fork 170
/
build-msi.yml
58 lines (53 loc) · 2.3 KB
/
build-msi.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
parameters:
CliVersion: $(CLI_VERSION)
Title: Build MSI
Condition: succeeded()
# Building for release will specify a version number directly and the MSI will
# be set to fail if it is installed over a later version. If
# ShouldBuildForRelease is false the MSI will be built with the version 0.1.0
# and will always install over any other installed version (even if the
# existing installed version is higher than 0.1.0).
ShouldBuildForRelease: true
steps:
- task: NuGetCommand@2
condition: ${{ parameters.Condition }}
displayName: Restore NuGet packages
inputs:
restoreSolution: cli/installer/windows.sln
- ${{ if eq(parameters.ShouldBuildForRelease, 'true') }}:
# Release build uses version and product name for release
- task: PowerShell@2
displayName: Get MSI version from CLI version
condition: ${{ parameters.Condition }}
inputs:
pwsh: true
targetType: filePath
filePath: eng/scripts/Get-MsiVersion.ps1
arguments: >-
-CliVersion "${{ parameters.CliVersion }}"
-DevOpsOutput
- pwsh: |
Write-Host "##vso[task.setvariable variable=MSI_PRODUCT_NAME_PARAM]/p:ProductName=`"Azure Developer CLI`""
Write-Host "##vso[task.setvariable variable=MSI_VERSION_PARAM]/p:ProductVersion=$(MSI_VERSION)"
condition: ${{ parameters.Condition }}
displayName: Set MSI_PRODUCT_NAME_PARAM for release
- ${{ else }}:
# Leave version and product name empty for dev build (allows dev version to)
# install over any previously installed version. These variables must be set
# or DevOps will substitute in the literal string
# (e.g. '$(MSI_PRODUCT_NAME_PARAM)') into the msbuild command arguments.
- pwsh: |
Write-Host "##vso[task.setvariable variable=MSI_PRODUCT_NAME_PARAM]"
Write-Host "##vso[task.setvariable variable=MSI_VERSION_PARAM]"
condition: ${{ parameters.Condition }}
displayName: Set MSI_PRODUCT_NAME_PARAM and MSI_VERSION_PARAM for dev release
- task: MSBuild@1
displayName: ${{ parameters.Title }}
condition: ${{ parameters.Condition }}
inputs:
solution: cli/installer/windows.sln
msbuildArguments: >-
/p:RunWixToolsOutOfProc=true
/p:Configuration=Release
$(MSI_PRODUCT_NAME_PARAM)
$(MSI_VERSION_PARAM)