-
-
Notifications
You must be signed in to change notification settings - Fork 52
131 lines (111 loc) · 5.39 KB
/
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: TableCloth Build Pipeline
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
configuration: [Debug]
platform: [x64] # Windows-AArch64 build machine is not available currently on GitHub (as of Aug, 2022)
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: windows-2022
env:
Solution_Name: src\TableCloth.sln
Hostess_Project_Path: src\Hostess\Hostess.csproj
ResourceBuilder_Project_Path: src\TableCloth.ResourceBuilder\TableCloth.ResourceBuilder.csproj
Loom_Project_Path: src\Loom\Loom.csproj
TableCloth_Project_Directory: src\TableCloth
TableCloth_Project_Path: src\TableCloth\TableCloth.csproj
Setup_Project_Name: TableCloth.SetupBuilder
Setup_Project_Directory: src\TableCloth.SetupBuilder
Setup_Project_Path: src\TableCloth.SetupBuilder\TableCloth.SetupBuilder.csproj
Platform: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
#token: ${{ secrets.TABLECLOTH_GITHUB_PAT }}
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
# Setup NuGet CLI
- name: Setup NuGet CLI
uses: nuget/setup-nuget@v1
with:
nuget-version: '5.x'
# Restore .NET Framework nuget packages
- name: Restore the application (.NET Framework Part)
run: nuget restore $env:Solution_Name
# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application (.NET Core Part)
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration /m
env:
Configuration: ${{ matrix.configuration }}
# Build Hostess project separately
- name: Build Hostess project
run: msbuild $env:Hostess_Project_Path /p:Configuration=$env:Configuration /p:Platform=$env:Platform /m
env:
Configuration: ${{ matrix.configuration }}
# Build ResourceBuilder project separately
- name: Build ResourceBuilder project
run: msbuild $env:ResourceBuilder_Project_Path /p:Configuration=$env:Configuration /p:Platform=$env:Platform /m
env:
Configuration: ${{ matrix.configuration }}
# Execute all unit tests in the solution
#- name: Execute unit tests
# run: dotnet test -c:$env:Configuration
# env:
# Configuration: ${{ matrix.configuration }}
# Publish TableCloth project
- name: Build TableCloth project
run: dotnet publish $env:TableCloth_Project_Path -r win-${{ env.Platform }} --self-contained -p:PublishSingleFile=true -p:PublishReadyToRun=true -c:$env:Configuration
env:
Configuration: ${{ matrix.configuration }}
# Build Loom project separately
- name: Build Loom project
run: dotnet publish $env:Loom_Project_Path -r win-${{ env.Platform }} --self-contained -p:PublishSingleFile=true -p:PublishReadyToRun=true -c:$env:Configuration
env:
Configuration: ${{ matrix.configuration }}
- name: Set path for candle and light
run: echo "$env:WIX_PATH\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
env:
WIX_PATH: ${{ env.wix }}
# Build setup builder project separately
- name: Build setup builder project
run: msbuild $env:Setup_Project_Path /p:Configuration=$env:Configuration /p:Platform=$env:Platform /m
env:
Configuration: ${{ matrix.configuration }}
# Run Setup builder
- name: Run setup builder
run: |
$SetupBuilderFullPath = [System.IO.Path]::GetFullPath('${{ env.Setup_Project_Directory }}\bin\${{ env.Platform }}\${{ matrix.configuration }}\${{ env.Setup_Project_Name }}.exe')
$InputDirPath = [System.IO.Path]::GetFullPath('${{ env.TableCloth_Project_Directory }}\bin\${{ env.Platform }}\${{ matrix.configuration }}\net6.0-windows10.0.18362.0\win-${{ env.Platform }}\publish')
$IconFilePath = [System.IO.Path]::GetFullPath('${{ env.TableCloth_Project_Directory }}\App.ico')
echo $SetupBuilderFullPath
echo $InputDirPath
echo $IconFilePath
dir $SetupBuilderFullPath -ErrorAction Continue
dir $InputDirPath -ErrorAction Continue
dir $IconFilePath -ErrorAction Continue
. $SetupBuilderFullPath $InputDirPath '--ignore--' '--ignore--' $IconFilePath
# Upload the MSI package: https://github.com/actions/upload-artifact
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: MSI Package Nightly (${{ matrix.platform }}, ${{ matrix.configuration }})
path: TableCloth.msi
if-no-files-found: warn
retention-days: 5
# Upload the zip package: https://github.com/actions/upload-artifact
- name: Upload build artifacts (Loom CLI)
uses: actions/upload-artifact@v3
with:
name: Loom CLI (${{ matrix.platform }}, ${{ matrix.configuration }})
path: src\Loom\bin\${{ env.Platform }}\${{ matrix.configuration }}\net6.0\win-${{ env.Platform }}\publish\Loom.exe
if-no-files-found: error
retention-days: 90