PanelSwWixExtension #247
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.0207-20 | |
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 }}", "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.0142-17' | |
- 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 | |
- name: Build PanelSwWixExtension | |
run: msbuild dirs.proj -restore -p:NugetDir="" -p:FullVersion=${{ env.FULL_VERSION }} | |
- name: Build PanelSwWixExtension with PanelSwWix4 | |
run: | | |
msbuild dirs.proj -t:WixtoolsetToPanelSwWix4 "-p:PanelSwWix4Version=${{ env.PSW_WIX_VERSION }}" | |
Remove-Item ("${{ github.workspace }}" + "\build") -Recurse -Force | |
dotnet restore dirs.proj "-p:PanelSwWix4Version=${{ env.PSW_WIX_VERSION }}" | |
msbuild dirs.proj -restore -p:NugetDir="" -p:FullVersion=${{ env.FULL_VERSION }} "-p:PanelSwWix4Version=${{ env.PSW_WIX_VERSION }}" "-p:NugetPrereleaseVersion=-psw-wix" | |
- uses: actions/[email protected] | |
with: | |
name: nuget | |
path: nuget-out\*.nupkg | |
- 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 |