Skip to content

PanelSwWixExtension #419

PanelSwWixExtension

PanelSwWixExtension #419

name: PanelSwWixExtension
on:
pull_request:
workflow_dispatch:
inputs:
publish_nuget:
description: 'Publish nuget package?'
required: true
default: false
type: boolean
psw_wix_version:
description: 'Custom WiX version'
required: true
default: '3.15.0-a65'
type: string
jobs:
PanelSwWixExtension-Build:
runs-on: windows-2019
steps:
- uses: actions/[email protected]
with:
submodules: 'true'
- uses: microsoft/setup-msbuild@v2
- name: Resolve build version
run: |
$xmlDoc = New-Object System.Xml.XmlDocument
$file = [System.IO.Path]::Combine( "${{ github.workspace }}", "TidyBuild.custom.props")
[xml]$xmlDoc = Get-Content $file
$node = $xmlDoc.SelectSingleNode('//*[local-name(.)="FullVersion"]')
Add-Content -Path ${{ github.env }} -Value ("FULL_VERSION=" + $node.InnerText + ".${{ github.run_number }}")
if ('${{ github.event.inputs.psw_wix_version }}') {
Add-Content -Path ${{ github.env }} -Value "CUSTOM_WIX_VERSION=${{ github.event.inputs.psw_wix_version }}"
} else {
Add-Content -Path ${{ github.env }} -Value "CUSTOM_WIX_VERSION=${{ env.DEFAULT_CUSTOM_WIX_VERSION }}"
}
env:
DEFAULT_CUSTOM_WIX_VERSION: '3.15.0-a65'
- name: Prepare for build
run: |
choco install windows-adk-all --version=10.1.22621.1
nuget restore
cmake.exe -G "Visual Studio 16 2019" -T v142,host=x86 -A Win32 .\protobuf\cmake -Dprotobuf_BUILD_TESTS=OFF -B build-v142\protobuf
cmake.exe --build build-v142\protobuf --config Release
cmake.exe -G "Visual Studio 16 2019" -T v141_xp,host=x86 -A Win32 .\protobuf\cmake -Dprotobuf_BUILD_TESTS=OFF -B build\protobuf
cmake.exe --build build\protobuf --config Release
cmake.exe -G "Visual Studio 16 2019" -T v141_xp,host=x86 -A Win32 .\poco -DPOCO_STATIC=ON -DPOCO_MT=ON -B build\poco
cmake.exe --build build\poco --config Release
- name: Build CaCommon v142
run: |
msbuild ProtoCaLib\ProtoCaLib.vcxproj -p:Configuration=Release -p:Platform=x86 -p:PlatformToolset=v142 -p:BuildFolder="${{ github.workspace }}\build-v142" -p:SolutionDir="${{ github.workspace }}"
msbuild CaCommon\CaCommon.vcxproj -p:Configuration=Release -p:Platform=x86 -p:PlatformToolset=v142 -p:BuildFolder="${{ github.workspace }}\build-v142" -p:SolutionDir="${{ github.workspace }}"
- name: Build PanelSwWixExtension for default WiX
run: msbuild PanelSwWixExtension.sln -p:Configuration=Release -p:Platform=x86 -p:NugetDir="" -p:FullVersion=${{ env.FULL_VERSION }}
- name: Clean
run: |
Remove-Item "build\bin" -Force -Recurse
Remove-Item "build\obj" -Force -Recurse
Remove-Item "build\lib" -Force -Recurse
Remove-Item "build-v142\bin\Release\CaCommon" -Force -Recurse
Remove-Item "build-v142\obj\Release\CaCommon" -Force -Recurse
- name: Update nuspec dependency on custom WiX version
run: |
nuget install PanelSW.Custom.WiX -version ${{ env.CUSTOM_WIX_VERSION }}
$xmlDoc = New-Object System.Xml.XmlDocument
$file = [System.IO.Path]::Combine( "${{ github.workspace }}" , "PanelSwWixExtension", "PanelSwWixExtension-psw-wix.nuspec")
[xml]$xmlDoc = Get-Content $file
$node = $xmlDoc.SelectSingleNode('//*[local-name(.)="dependency" and ./@id="PanelSW.Custom.WiX"]/@version')
$node.Value = "${{ env.CUSTOM_WIX_VERSION }}"
$xmlDoc.Save($file)
git diff -w
- name: Build CaCommon v142 for custom WiX
run: |
msbuild CaCommon\CaCommon.vcxproj -p:Configuration=Release -p:Platform=x86 -p:PlatformToolset=v142 -p:BuildFolder="${{ github.workspace }}\build-v142" -p:SolutionDir="${{ github.workspace }}" -p:WixToolPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\bin\" -p:WixSdkPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\sdk\" -p:WixTargetsPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\bin\Wix.targets" -p:WixCATargetsPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\sdk\Wix.CA.targets" -p:WixNativeCATargetsPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\sdk\Wix.NativeCA.targets" -p:WixTasksPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\bin\wixtasks.dll" -p:WixInstallPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\bin\" -p:WixExtDir="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\bin\" -p:LuxTargetsPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\bin\lux.targets"
- name: Build PanelSwWixExtension for custom WiX
run: |
msbuild PanelSwWixExtension.sln -p:Configuration=Release -p:Platform=x86 -p:NugetDir="" -p:FullVersion=${{ env.FULL_VERSION }} -p:NugetPrereleaseVersion=-psw-wix -p:WixToolPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\bin\" -p:WixSdkPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\sdk\" -p:WixTargetsPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\bin\Wix.targets" -p:WixCATargetsPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\sdk\Wix.CA.targets" -p:WixNativeCATargetsPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\sdk\Wix.NativeCA.targets" -p:WixTasksPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\bin\wixtasks.dll" -p:WixInstallPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\bin\" -p:WixExtDir="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\bin\" -p:LuxTargetsPath="${{ github.workspace }}\PanelSW.Custom.WiX.${{ env.CUSTOM_WIX_VERSION }}\tools\bin\lux.targets"
- uses: actions/[email protected]
with:
name: nuget
path: build\nuget-out\*.nupkg
- name: Publish nuget packages to github and nuget.org
if: ${{ github.event.inputs.publish_nuget == 'true' && github.ref == 'refs/heads/master' }}
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_PAT }}
run: |
dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
dotnet nuget push build\nuget-out\PanelSwWixExtension.${{ env.FULL_VERSION }}-psw-wix.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source github
dotnet nuget push build\nuget-out\PanelSwWixExtension.${{ env.FULL_VERSION }}.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source github
dotnet nuget push build\nuget-out\PanelSwWixExtension.${{ env.FULL_VERSION }}-psw-wix.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json
dotnet nuget push build\nuget-out\PanelSwWixExtension.${{ env.FULL_VERSION }}.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json
git tag "wix3-v${{ env.FULL_VERSION }}"
git push --tags