Skip to content

PanelSwWixExtension #409

PanelSwWixExtension

PanelSwWixExtension #409

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: 6.0.0-psw-wix.0326-29
type: string
jobs:
PanelSwWixExtension-Build:
runs-on: windows-latest
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 }}", "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: '6.0.0-psw-wix.0326-29'
- 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: 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/master5' }}
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 "wix5-v${{ env.FULL_VERSION }}"
git push --tags