-
-
Notifications
You must be signed in to change notification settings - Fork 10
71 lines (63 loc) · 3.04 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
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-2019
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: 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