Merge pull request #2664 from rcurtin/azure-msi

Use Azure to build the MSI installer
This commit is contained in:
Ryan Curtin
2020-11-30 09:32:41 -05:00
committed by GitHub
4 changed files with 97 additions and 77 deletions
-19
View File
@@ -59,25 +59,6 @@ jobs:
steps:
- template: macos-steps.yaml
# - job: WindowsVS15
# timeoutInMinutes: 360
# displayName: Windows VS15
# pool:
# vmImage: vs2017-win2016
# strategy:
# matrix:
# Plain:
# CMakeArgs: '-DDEBUG=ON -DPROFILE=OFF -DBUILD_PYTHON_BINDINGS=OFF -DBUILD_GO_BINDINGS=OFF -DBUILD_R_BINDINGS=OFF'
# python.version: '2.7'
# CMakeGenerator: '-G "Visual Studio 15 2017 Win64"'
# MSBuildVersion: '15.0'
# ArchiveNoLibs: 'mlpack-windows-vs15-no-libs.zip'
# ArchiveLibs: 'mlpack-windows-vs15.zip'
# ArchiveTests: 'mlpack_test-vs15.xml'
# steps:
# - template: windows-steps.yaml
- job: WindowsVS16
timeoutInMinutes: 360
displayName: Windows VS16
+55
View File
@@ -116,6 +116,56 @@ steps:
replaceExistingArchive: true
displayName: 'Build artifacts'
# Build MSI installer.
- powershell: |
# Pull the documentation for the installer.
try {
$url = "http://ci.mlpack.org/job/mlpack%20-%20doxygen%20build/lastSuccessfulBuild/artifact/build/doc/html/*zip*/html.zip"
(new-object net.webclient).DownloadFile($url, 'dist\win-installer\jenkinsdoc.zip')
}
catch {
Write-Output "Unable to download precompiled Doxygen documentation from Jenkins!"
}
try {
(Add-Type -AssemblyName System.IO.Compression.FileSystem);
[System.IO.Compression.ZipFile]::ExtractToDirectory('dist\win-installer\jenkinsdoc.zip', 'dist\win-installer\mlpack-win-installer\Sources\doc')
}
catch{Write-Output "Unable to add doc to installer, skipping!"}
# Preparing installer staging.
mkdir dist\win-installer\mlpack-win-installer\Sources\lib
cp build\Release\*.lib dist\win-installer\mlpack-win-installer\Sources\lib\
cp build\Release\*.exp dist\win-installer\mlpack-win-installer\Sources\lib\
cp build\Release\*.dll dist\win-installer\mlpack-win-installer\Sources\
cp build\Release\*.exe dist\win-installer\mlpack-win-installer\Sources\
cp $(Agent.ToolsDirectory)\OpenBLAS.0.2.14.1\lib\native\bin\x64\*.dll dist\win-installer\mlpack-win-installer\Sources\
cp build\include\mlpack dist\win-installer\mlpack-win-installer\Sources -recurse
cp doc\examples dist\win-installer\mlpack-win-installer\Sources -recurse
cp src\mlpack\tests\data\german.csv dist\win-installer\mlpack-win-installer\Sources\examples\sample-ml-app\sample-ml-app\data\
# Check current git version or mlpack version.
$ver = (Get-Content "src\mlpack\core\util\version.hpp" | where {$_ -like "*MLPACK_VERSION*"});
$env:MLPACK_VERSION += $ver[0].substring($ver[0].length - 1, 1) + '.';
$env:MLPACK_VERSION += $ver[1].substring($ver[1].length - 1, 1) + '.';
$env:MLPACK_VERSION += $ver[2].substring($ver[2].length - 1, 1);
if (Test-Path "src/mlpack/core/util/gitversion.hpp")
{
$ver = (Get-Content "src/mlpack/core/util/gitversion.hpp");
$env:INSTALL_VERSION = $ver.Split('"')[1].Split(' ')[1];
}
else
{
$env:INSTALL_VERSION = $env:MLPACK_VERSION;
}
# Build the MSI installer.
cd dist\win-installer\mlpack-win-installer
& 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe' `
-t:rebuild `
-p:Configuration=Release `
-p:TreatWarningsAsErrors=True `
mlpack-win-installer.wixproj
displayName: 'Build MSI Windows installer'
# Publish artifacts to Azure Pipelines
- task: PublishBuildArtifacts@1
inputs:
@@ -132,6 +182,11 @@ steps:
pathtoPublish: 'build/Testing/'
artifactName: 'Tests'
displayName: 'Publish artifacts test results'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'dist\win-installer\mlpack-win-installer\bin\Release\mlpack-windows.msi'
artifactName: mlpack-windows-installer
displayName: 'Publish Windows MSI installer'
# Publish test results to Azure Pipelines
- task: PublishTestResults@2
+30 -39
View File
@@ -2,47 +2,38 @@
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<!-- 1) DO NOT CHANGE the product GUID! It is forever -->
<!-- 2) %MLPACK_VERSION env var is set by .appveyor.yml -->
<Product Id="02A00C77-197D-4E91-B7D9-5836220E92E9"
UpgradeCode="6C2D7EC0-6F10-40CB-9703-1DC160A62662"
Name="mlpack"
Language="1033"
Version="$(env.MLPACK_VERSION)"
Manufacturer="mlpack">
<Package InstallerVersion="200"
Description="mlpack Windows Installer"
Compressed="yes"
InstallScope="perMachine"
Platform="x64"/>
<Product Id="02A00C77-197D-4E91-B7D9-5836220E92E9"
UpgradeCode="6C2D7EC0-6F10-40CB-9703-1DC160A62662"
Name="mlpack"
Language="1033"
Version="$(env.MLPACK_VERSION)"
Manufacturer="mlpack">
<Package InstallerVersion="200"
Description="mlpack Windows Installer"
Compressed="yes"
InstallScope="perMachine"
Platform="x64"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes"/>
<Feature Id="ProductFeature" Title="mlpackWindows" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<Property Id="MLPACK_VERSION">$(env.MLPACK_VERSION)</Property>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<WixVariable Id="WixUILicenseRtf" Value="..\staging\license.rtf"/>
<WixVariable Id="WixUIBannerBmp" Value="..\res\banner.jpg"/>
<WixVariable Id="WixUIDialogBmp" Value="..\res\dialog_white.jpg"/>
<UIRef Id="WixUI_InstallDir" />
</Product>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="INSTALLDIR" Name="mlpack">
<Directory Id="Sources" />
</Directory>
</Directory>
</Directory>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="INSTALLFOLDER" Name="mlpack" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- This references the list of mlpack files automatically generated using Heat (see .wixproj BeforeBuild Target) -->
<ComponentGroupRef Id="HeatGenerated"/>
</ComponentGroup>
</Fragment>
<Feature Id="ProductFeature" Title="mlpackWindows" ConfigurableDirectory="INSTALLDIR" Level="1">
<ComponentGroupRef Id="Sources" />
</Feature>
<Property Id="MLPACK_VERSION">$(env.MLPACK_VERSION)</Property>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<WixVariable Id="WixUILicenseRtf" Value="..\staging\license.rtf"/>
<WixVariable Id="WixUIBannerBmp" Value="..\res\banner.jpg"/>
<WixVariable Id="WixUIDialogBmp" Value="..\res\dialog_white.jpg"/>
<UIRef Id="WixUI_InstallDir" />
</Product>
</Wix>
@@ -9,33 +9,36 @@
<OutputName>mlpack-windows</OutputName>
<OutputType>Package</OutputType>
<Name>mlpack-win-installer</Name>
<DefineSolutionProperties>false</DefineSolutionProperties>
<DefineConstants>SourceDir=.\Sources</DefineConstants>
<WixTargetsPath Condition=" '$(WixTargetsPath' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
<DefineConstants>Debug;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DefineConstants>Debug</DefineConstants>
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup>
<DefineConstants>HarvestPath=..\staging</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="Product.wxs" />
<Compile Include="HeatGeneratedFileList.wxs" />
</ItemGroup>
<ItemGroup>
<HarvestDirectory Include=".\Sources">
<DirectoryRefId>Sources</DirectoryRefId>
<ComponentGroupName>Sources</ComponentGroupName>
<PreprocessorVariable>var.SourceDir</PreprocessorVariable>
<SuppressRegistry>true</SuppressRegistry>
</HarvestDirectory>
<WixExtension Include="WixUIExtension">
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
<Name>WixUIExtension</Name>
@@ -46,14 +49,4 @@
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
</Target>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.-->
<Target Name="BeforeBuild">
<HeatDirectory Directory="..\staging" PreprocessorVariable="var.HarvestPath" OutputFile="HeatGeneratedFileList.wxs" ComponentGroupName="HeatGenerated" DirectoryRefId="INSTALLFOLDER" AutogenerateGuids="true" ToolPath="$(WixToolPath)" SuppressFragments="true" SuppressRegistry="true" SuppressRootDirectory="true" />
</Target>
<!--
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>