From e78962d8d03cbe5ede365b249c4da7ac2e8ffbdb Mon Sep 17 00:00:00 2001 From: mattprost Date: Thu, 16 Jun 2022 10:36:33 -0500 Subject: ci: Make Windows installer job self-contained Rebuild UHD to generate the Windows installer. This increases the time it takes for the job to run, but it removes any interference that other jobs may have had on the build environment. Signed-off-by: mattprost --- .ci/templates/job-uhd-build-installer.yml | 11 ++---- .ci/templates/stages-uhd-pipeline.yml | 1 + .../steps-build-uhd-installer-msbuild-nsis.yml | 40 ++++++++++++++++++++++ 3 files changed, 43 insertions(+), 9 deletions(-) (limited to '.ci/templates') diff --git a/.ci/templates/job-uhd-build-installer.yml b/.ci/templates/job-uhd-build-installer.yml index 1c22bf9cb..cc951483a 100644 --- a/.ci/templates/job-uhd-build-installer.yml +++ b/.ci/templates/job-uhd-build-installer.yml @@ -78,21 +78,14 @@ jobs: uhdSrcDir: $(Build.SourcesDirectory) uhdInstallerDir: $(Build.BinariesDirectory)/uhddev-installer ubuntuReleaseName: $(ubuntuReleaseName) - - ${{ if and(ne(parameters.toolset, 'ubuntu_deb'), ne(parameters.toolset, 'fedora_rpm')) }}: - - download: current - artifact: uhddev-$(buildOSName)-${{ parameters.toolset }} - displayName: Download pipeline artifact uhddev-$(buildOSName)-${{ parameters.toolset }} - - task: ExtractFiles@1 - inputs: - archiveFilePatterns: $(Pipeline.Workspace)/uhddev-$(buildOSName)-${{ parameters.toolset }}/uhddev-$(buildOSName)-${{ parameters.toolset }}.tar.gz - destinationFolder: $(Build.BinariesDirectory) - cleanDestinationFolder: true - ${{ if and(eq(parameters.toolset, 'msbuild'), eq(parameters.installer, 'nsis')) }}: - template: steps-build-uhd-installer-msbuild-nsis.yml parameters: uhdSrcDir: $(Build.SourcesDirectory) uhdBuildDir: $(Build.BinariesDirectory)\\uhddev\\build uhdInstallerDir: $(Build.BinariesDirectory)\\uhddev-installer + uhdImageDir: $(Build.BinariesDirectory)\\uhd-images + uhdReleaseBinaries: ${{ parameters.releaseBinaries }} cmakeCompiler: $(cmakeCompiler) cmakeArch: $(cmakeArch) vsArch: $(vsArch) diff --git a/.ci/templates/stages-uhd-pipeline.yml b/.ci/templates/stages-uhd-pipeline.yml index 17017f9e2..f8d5f9ea0 100644 --- a/.ci/templates/stages-uhd-pipeline.yml +++ b/.ci/templates/stages-uhd-pipeline.yml @@ -220,6 +220,7 @@ stages: parameters: toolset: msbuild installer: nsis + releaseBinaries: ${{ parameters.release_binaries }} - ${{ if parameters.release_binaries }}: - template: job-uhd-build-installer-signing.yml parameters: diff --git a/.ci/templates/steps-build-uhd-installer-msbuild-nsis.yml b/.ci/templates/steps-build-uhd-installer-msbuild-nsis.yml index ba388e5f6..326106f41 100644 --- a/.ci/templates/steps-build-uhd-installer-msbuild-nsis.yml +++ b/.ci/templates/steps-build-uhd-installer-msbuild-nsis.yml @@ -5,6 +5,11 @@ parameters: type: string - name: uhdInstallerDir type: string +- name: uhdImageDir + type: string +- name: uhdReleaseBinaries + type: boolean + default: false - name: cmakeCompiler type: string - name: cmakeArch @@ -15,11 +20,46 @@ parameters: type: string steps: +- script: | + mkdir ${{ parameters.uhdBuildDir }} + cd ${{ parameters.uhdBuildDir }} + cmake ${{ parameters.uhdSrcDir }}/host ^ + -DVCPKG_TARGET_TRIPLET=uhd-$(vsArch)-windows-static-md ^ + -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALL_DIR%/scripts/buildsystems/vcpkg.cmake + mkdir ${{ parameters.uhdImageDir }} + python ${{ parameters.uhdBuildDir }}/utils/uhd_images_downloader.py -i ${{ parameters.uhdImageDir }} + displayName: Download uhd-images + timeoutInMinutes: 30 + +- script: | + cd $(Pipeline.Workspace) + rmdir ${{ parameters.uhdBuildDir }} /s /q + displayName: Clean build directory + +- script: | + mkdir ${{ parameters.uhdBuildDir }} + cd ${{ parameters.uhdBuildDir }} + if "${{ parameters.uhdReleaseBinaries }}" == "True" ( + echo "Setting Release Mode" + SET UHD_CI_CMAKE_OPTIONS="-DUHD_RELEASE_MODE=release %UHD_CI_CMAKE_OPTIONS%" + ) + cmake ${{ parameters.uhdSrcDir }}/host ^ + -DVCPKG_TARGET_TRIPLET=uhd-$(vsArch)-windows-static-md ^ + -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALL_DIR%/scripts/buildsystems/vcpkg.cmake ^ + -DUHD_IMAGES_SRC_DIR="${{ parameters.uhdImageDir }}" ^ + -DUHD_IMAGES_DIR="C:\\Program Files (x86)\\UHD\\share\\uhd\\images,C:\\Program Files\\UHD\\share\\uhd\\images" ^ + -DSPECIFY_MSVC_VERSION=ON ^ + -DENABLE_DOXYGEN_SHORTNAMES=ON ^ + %UHD_CI_CMAKE_OPTIONS% ^ + -G "$(cmakeCompiler)" -A $(cmakeArch) + displayName: cmake msbuild UHD + - script: | cd ${{ parameters.uhdBuildDir }} call "C:\Program Files (x86)\Microsoft Visual Studio\$(vsYear)\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" $(vsArch) msbuild.exe package.vcxproj /p:configuration=release displayName: msbuild package + - task: CopyFiles@2 inputs: sourceFolder: ${{ parameters.uhdBuildDir }} -- cgit v1.2.3