-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (133 loc) · 5.58 KB
/
Copy pathpack.yml
File metadata and controls
147 lines (133 loc) · 5.58 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
name: Pack
on:
workflow_dispatch:
inputs:
project:
description: 'Project to pack (name equals .csproj filename without extension)'
required: true
type: choice
options:
- OutWit.Common
- OutWit.Common.Aspects
- OutWit.Common.CommandLine
- OutWit.Common.Logging
- OutWit.Common.Logging.Abstractions
- OutWit.Common.Rest
- OutWit.Common.Reflection
- OutWit.Common.Proxy
- OutWit.Common.Proxy.Generator
- OutWit.Common.Json
- OutWit.Common.MemoryPack
- OutWit.Common.MessagePack
- OutWit.Common.ProtoBuf
- OutWit.Common.MVVM
- OutWit.Common.MVVM.WPF
- OutWit.Common.MVVM.WPF.Generator
- OutWit.Common.MVVM.Avalonia
- OutWit.Common.MVVM.Avalonia.Generator
- OutWit.Common.MVVM.Blazor
- OutWit.Common.MVVM.Navigation
- OutWit.Common.MVVM.Navigation.Avalonia
- OutWit.Common.MVVM.Navigation.Avalonia.DialogHost
- OutWit.Common.MVVM.Navigation.WPF
- OutWit.Common.MVVM.Navigation.Modules
- OutWit.Common.NUnit
- OutWit.Common.Platform
- OutWit.Common.Plugins
- OutWit.Common.Plugins.Abstractions
- OutWit.Common.Settings
- OutWit.Common.Settings.Json
- OutWit.Common.Settings.Csv
- OutWit.Common.Settings.Database
- OutWit.Common.Configuration
- OutWit.Common.DependencyInjection
- OutWit.Common.DependencyInjection.Generator
- OutWit.Common.Email
- OutWit.Common.Fat
- OutWit.Common.Forms
- OutWit.Common.Forms.MessagePack
- OutWit.Common.Messenger
- OutWit.Common.Logging.Query
- OutWit.Common.Logging.NewRelic
- OutWit.Common.Logging.Loki
permissions:
contents: read
jobs:
pack:
runs-on: windows-latest
env:
PROJECT: ${{ github.event.inputs.project }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET SDKs (6/7/8/9/10)
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
9.0.x
10.0.x
- name: Cache NuGet
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.slnx', '**/*.csproj') }}
restore-keys: |
nuget-${{ runner.os }}-
- name: Restore slnx
run: dotnet restore OutWit.slnx
- name: Resolve project paths
id: paths
shell: pwsh
run: |
$projName = '${{ env.PROJECT }}'
$lib = Get-ChildItem -Recurse -Filter "$projName.csproj" | Select-Object -Expand FullName -First 1
if (!$lib) { Write-Error "Library project $projName.csproj not found"; exit 1 }
"libCsproj=$lib" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
Write-Host "Resolved: $lib"
# Check if this project embeds a generator and needs it built first
# Projects that embed generators: OutWit.Common.Proxy, OutWit.Common.MVVM.WPF, OutWit.Common.MVVM.Avalonia, OutWit.Common.DependencyInjection
$generatorProject = ""
switch ($projName) {
"OutWit.Common.Proxy" {
$generatorProject = Get-ChildItem -Recurse -Filter "OutWit.Common.Proxy.Generator.csproj" | Select-Object -Expand FullName -First 1
}
"OutWit.Common.MVVM.WPF" {
$generatorProject = Get-ChildItem -Recurse -Filter "OutWit.Common.MVVM.WPF.Generator.csproj" | Select-Object -Expand FullName -First 1
}
"OutWit.Common.MVVM.Avalonia" {
$generatorProject = Get-ChildItem -Recurse -Filter "OutWit.Common.MVVM.Avalonia.Generator.csproj" | Select-Object -Expand FullName -First 1
}
"OutWit.Common.DependencyInjection" {
$generatorProject = Get-ChildItem -Recurse -Filter "OutWit.Common.DependencyInjection.Generator.csproj" | Select-Object -Expand FullName -First 1
}
}
if ($generatorProject) {
"generatorCsproj=$generatorProject" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
"hasGenerator=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
Write-Host "Associated generator: $generatorProject"
} else {
"hasGenerator=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
Write-Host "No associated generator"
}
- name: Build generator (if needed)
if: steps.paths.outputs.hasGenerator == 'true'
run: dotnet build "${{ steps.paths.outputs.generatorCsproj }}" --configuration Release
- name: Build (all target frameworks)
run: dotnet build "${{ steps.paths.outputs.libCsproj }}" --configuration Release -p:ContinuousIntegrationBuild=true
- name: Pack (no build)
run: dotnet pack "${{ steps.paths.outputs.libCsproj }}" --configuration Release --no-build
- name: Collect packages
shell: pwsh
run: |
if (!(Test-Path "NuGet")) { New-Item -ItemType Directory -Force -Path "NuGet" | Out-Null }
Get-ChildItem -Recurse -Include *.nupkg,*.snupkg -Path . |
Where-Object { $_.FullName -match "\\bin\\Release\\" } |
Copy-Item -Destination "NuGet" -Force
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages-${{ env.PROJECT }}
path: NuGet/*
if-no-files-found: error