Repository navigation
148 lines (122 loc) · 4.2 KB
/
Copy pathbuild.yml
File metadata and controls
148 lines (122 loc) · 4.2 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Legacy Build
# This workflow is deprecated. Please use ci.yml instead.
# Kept for reference only.
on:
workflow_dispatch:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
configuration: [Debug, Release]
platform: [Any CPU, x64, x86]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for GitVersion
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Restore NuGet packages
run: |
nuget restore "Source/Current/Windows API CodePack/Windows API CodePack.sln"
- name: Build Solution
run: |
msbuild "Source/Current/Windows API CodePack/Windows API CodePack.sln" `
/p:Configuration=${{ matrix.configuration }} `
/p:Platform="${{ matrix.platform }}" `
/p:RestorePackages=false `
/m `
/verbosity:minimal
- name: Upload build artifacts
if: matrix.configuration == 'Release'
uses: actions/upload-artifact@v4
with:
name: build-artifacts-${{ matrix.platform }}-${{ matrix.configuration }}
path: |
Output/bin/${{ matrix.configuration }}/
!Output/bin/${{ matrix.configuration }}/**/*.pdb
!Output/bin/${{ matrix.configuration }}/**/obj/
retention-days: 7
package:
runs-on: windows-latest
needs: build
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- name: Restore NuGet packages
run: |
nuget restore "Source/Current/Windows API CodePack/Windows API CodePack.sln"
- name: Build Release
run: |
msbuild "Source/Current/Windows API CodePack/Windows API CodePack.sln" `
/p:Configuration=Release `
/p:Platform="Any CPU" `
/p:RestorePackages=false `
/m `
/verbosity:minimal
- name: Collect NuGet packages
run: |
New-Item -ItemType Directory -Force -Path "packages"
Get-ChildItem -Path "Output/bin/Release" -Filter "*.nupkg" -Recurse | Copy-Item -Destination "packages"
Get-ChildItem -Path "Output/bin/Release" -Filter "*.snupkg" -Recurse | Copy-Item -Destination "packages"
- name: Upload NuGet packages
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: packages/
retention-days: 30
- name: List generated packages
run: |
Write-Host "Generated NuGet packages:"
Get-ChildItem -Path "packages" -Filter "*.nupkg" | ForEach-Object { Write-Host " - $($_.Name)" }
Write-Host "Generated Symbol packages:"
Get-ChildItem -Path "packages" -Filter "*.snupkg" | ForEach-Object { Write-Host " - $($_.Name)" }
test:
runs-on: windows-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
# Note: Add test discovery and execution here when test projects are available
# Currently the solution doesn't appear to have test projects
- name: Run tests (placeholder)
run: |
Write-Host "No test projects found in the current solution structure."
Write-Host "Consider adding test projects to improve code quality and reliability."