PanelSwWixExtension #370
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | |
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Community" | |
$args = ( 'modify', '--installPath', $InstallPath, '--all', '--quiet', '--norestart', '--nocache' ) | |
Start-Process -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -Wait -PassThru -NoNewWindow -ArgumentList $args | |
Start-Process -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -Wait -PassThru -NoNewWindow -ArgumentList $args | |
- name: Install components | |
run: | | |
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" | |
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Community" | |
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",'--all', '--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 |