-
-
Notifications
You must be signed in to change notification settings - Fork 10
109 lines (92 loc) · 8.08 KB
/
github-actions-build.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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_MT=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DENABLE_XML=ON -DENABLE_ZIP=ON -DENABLE_ENCODINGS=OFF -DENABLE_UTIL=OFF -DENABLE_NET=OFF -DENABLE_MONGODB=OFF -DENABLE_REDIS=OFF -DENABLE_DNSSD=OFF -DENABLE_PROMETHEUS=OFF -DENABLE_PDF=OFF -DENABLE_JWT=OFF -DENABLE_NETSSL_WIN=OFF -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_DATA=OFF -DENABLE_DATA_SQLITE=OFF -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_ACTIVERECORD=OFF -DENABLE_ACTIVERECORD_COMPILER=OFF -DENABLE_APACHECONNECTOR=OFF -DENABLE_CPPPARSER=OFF -DENABLE_POCODOC=OFF -DENABLE_PAGECOMPILER=OFF -DENABLE_PAGECOMPILER_FILE2PAGE=OFF -DENABLE_ENCODINGS_COMPILER=OFF -DENABLE_TRACE=OFF -DENABLE_TESTS=OFF -DENABLE_DATA_ODBC=OFF -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