-
-
Notifications
You must be signed in to change notification settings - Fork 10
88 lines (78 loc) · 4.07 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
name: PanelSwWixExtension-WiX4
on:
pull_request:
workflow_dispatch:
inputs:
publish_nuget:
description: 'Publish nuget package?'
required: true
default: false
type: boolean
psw_wix_version:
description: 'PanelSwWix4 version'
required: true
default: 5.0.0-psw-wix.0275-51
type: string
jobs:
PanelSwWixExtension-Build:
runs-on: windows-latest
steps:
- uses: actions/[email protected]
with:
submodules: 'true'
- uses: microsoft/setup-msbuild@v1
- name: Resolve build version
run: |
$xmlDoc = New-Object System.Xml.XmlDocument
$file = [System.IO.Path]::Combine("${{ github.workspace }}", "src", "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 "PSW_WIX_VERSION=${{ github.event.inputs.psw_wix_version }}"
} else {
Add-Content -Path ${{ github.env }} -Value "PSW_WIX_VERSION=${{ env.DEFAULT_PSW_WIX_VERSION }}"
}
env:
DEFAULT_PSW_WIX_VERSION: '5.0.0-psw-wix.0275-51'
- name: Prepare for build
run: |
choco install windows-adk-all
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"
nuget restore src/dirs.proj
- name: Install VC ATL and MFC components
run: |
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
$componentsToInstall= @(
"Microsoft.VisualStudio.Component.VC.14.29.30133.ATL"
"Microsoft.VisualStudio.Component.VC.14.29.30133.ATL"
"Microsoft.VisualStudio.Component.VC.14.29.30133.ATLMFC"
"Microsoft.VisualStudio.Component.VC.14.29.30133.ATLMFC"
)
[string]$workloadArgs = $componentsToInstall | ForEach-Object {" --add " + $_}
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
# should be run twice
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
- name: Build PanelSwWixExtension
run: msbuild src/dirs.proj -restore -p:FullVersion=${{ env.FULL_VERSION }}
- name: Build PanelSwWixExtension with PanelSwWix4
run: |
msbuild src/dirs.proj -t:WixtoolsetToPanelSwWix4 "-p:PanelSwWix4Version=${{ env.PSW_WIX_VERSION }}" -p:NugetPrereleaseVersion=-psw-wix
Remove-Item ("${{ github.workspace }}" + "\build") -Recurse -Force
msbuild src/dirs.proj -restore -p:FullVersion=${{ env.FULL_VERSION }} "-p:PanelSwWix4Version=${{ env.PSW_WIX_VERSION }}" -p:NugetPrereleaseVersion=-psw-wix -p:EnableZipContainer=true
- uses: actions/[email protected]
with:
name: nuget
path: nuget-out\*.nupkg
if-no-files-found: error
- name: Publish nuget packages to github and nuget.org
if: ${{ github.event.inputs.publish_nuget == 'true' && github.ref == 'refs/heads/master4' }}
env:
GITHUB_TOKEN: ${{ secrets.TAGGER_PAT }}
run: |
dotnet nuget push nuget-out\PanelSwWixExtension4.*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source github
dotnet nuget push nuget-out\PanelSwWixExtension4.*.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json
git tag "wix4-v${{ env.FULL_VERSION }}"
git push --tags