-
Notifications
You must be signed in to change notification settings - Fork 86
202 lines (173 loc) · 11.2 KB
/
publish-nuget.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
name: Publish to NuGet
on:
push:
branches:
- "*"
pull_request:
# to update branch that publish happens on, edit the if: statement for the publish job
jobs:
test:
name: Unit testing
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4.1.1
- uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{secrets.NUGET_API_KEY}}
nuget-version: '5.x'
# - name: Add MSBuild to PATH
# uses: microsoft/setup-msbuild@v1.1.3
- name: Setup .NET 3.1, 5.0, 6.0, 7.0, 8.0 for tests
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
8.0.x
- name: Run NetSparkle.Tests in .NET 3.1
run: dotnet test -f netcoreapp3.1 ${{ github.workspace }}/src/NetSparkle.Tests/NetSparkle.Tests.csproj
- name: Run NetSparkle.Tests in .NET 5
run: dotnet test -f net5 ${{ github.workspace }}/src/NetSparkle.Tests/NetSparkle.Tests.csproj
- name: Run NetSparkle.Tests.AppCastGenerator in .NET 5
run: dotnet test -f net5 ${{ github.workspace }}/src/NetSparkle.Tests.AppCastGenerator/NetSparkle.Tests.AppCastGenerator.csproj
- name: Run NetSparkle.Tests in .NET 6
run: dotnet test -f net6 ${{ github.workspace }}/src/NetSparkle.Tests/NetSparkle.Tests.csproj
- name: Run NetSparkle.Tests.AppCastGenerator in .NET 6
run: dotnet test -f net6 ${{ github.workspace }}/src/NetSparkle.Tests.AppCastGenerator/NetSparkle.Tests.AppCastGenerator.csproj
- name: Run NetSparkle.Tests in .NET 7
run: dotnet test -f net7.0 ${{ github.workspace }}/src/NetSparkle.Tests/NetSparkle.Tests.csproj
- name: Run NetSparkle.Tests.AppCastGenerator in .NET 7
run: dotnet test -f net7.0 ${{ github.workspace }}/src/NetSparkle.Tests.AppCastGenerator/NetSparkle.Tests.AppCastGenerator.csproj
- name: Run NetSparkle.Tests in .NET 8
run: dotnet test -f net8.0 ${{ github.workspace }}/src/NetSparkle.Tests/NetSparkle.Tests.csproj
- name: Run NetSparkle.Tests.AppCastGenerator in .NET 8
run: dotnet test -f net8.0 ${{ github.workspace }}/src/NetSparkle.Tests.AppCastGenerator/NetSparkle.Tests.AppCastGenerator.csproj
publish:
name: Build and publish all packages to NuGet
runs-on: windows-latest
needs: test
if: github.ref == 'refs/heads/develop'
# Need to set ACTIONS_ALLOW_UNSECURE_COMMANDS for microsoft/setup-msbuild@v1.0.0 to work as it uses the now-deprecated addPath method
#env:
# ACTIONS_ALLOW_UNSECURE_COMMANDS: true
# microsoft/setup-msbuild@v1.1.3 fixes that deprecation issue.
steps:
- uses: actions/checkout@v4.1.1
- uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{secrets.NUGET_API_KEY}}
nuget-version: '5.x'
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.3.1
- name: Setup .NET 3.0, 3.1, 5.0, 6.0, 7.0
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: |
3.0
3.1.x
5.0.x
6.0.x
7.0.x
8.0.x
- name: Clean things to be safe
run: |
dotnet clean ${{ github.workspace }}/src/NetSparkle/NetSparkle.csproj --configuration Release
dotnet clean ${{ github.workspace }}/src/NetSparkle.UI.WinForms.NetCore/NetSparkle.UI.WinForms.NetCore.csproj --configuration Release
dotnet clean ${{ github.workspace }}/src/NetSparkle.UI.WPF/NetSparkle.UI.WPF.csproj --configuration Release
dotnet clean ${{ github.workspace }}/src/NetSparkle.Tools.AppCastGenerator/NetSparkle.Tools.AppCastGenerator.csproj --configuration Release
dotnet clean ${{ github.workspace }}/src/NetSparkle.Tools.DSAHelper/NetSparkle.Tools.DSAHelper.csproj --configuration Release
- name: Build NetSparkle in Release
run: dotnet build ${{ github.workspace }}/src/NetSparkle/NetSparkle.csproj --configuration Release
- name: Build NetSparkle.UI.WinForms.NetCore in Release
run: dotnet build ${{ github.workspace }}/src/NetSparkle.UI.WinForms.NetCore/NetSparkle.UI.WinForms.NetCore.csproj --configuration Release
- name: Build NetSparkle.UI.WPF in Release
run: dotnet build ${{ github.workspace }}/src/NetSparkle.UI.WPF/NetSparkle.UI.WPF.csproj --configuration Release
- name: Build NetSparkle.Tools.AppCastGenerator in Release
run: dotnet build ${{ github.workspace }}/src/NetSparkle.Tools.AppCastGenerator/NetSparkle.Tools.AppCastGenerator.csproj --configuration Release
- name: Build NetSparkle.Tools.DSAHelper in Release
run: dotnet build ${{ github.workspace }}/src/NetSparkle.Tools.DSAHelper/NetSparkle.Tools.DSAHelper.csproj --configuration Release
- name: Publish NetsparkleUpdater.NetSparkle on version change
uses: nitz/publish-nuget@60fd3adf9d9eecc3bbf8a98738734d3061347172
with:
PROJECT_FILE_PATH: ${{ github.workspace }}/src/NetSparkle/NetSparkle.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
# VERSION_REGEX: <Version>(.*)<\/Version> # Regex pattern to extract version info in a capturing group
TAG_COMMIT: false # Flag to enable / disalge git tagging
# TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version
NUGET_KEY: ${{secrets.NUGET_API_KEY}} # nuget.org API key
PACKAGE_NAME: NetSparkleUpdater.NetSparkle
INCLUDE_SYMBOLS: true
- name: Publish NetSparkleUpdater.UI.WPF on version change
uses: nitz/publish-nuget@60fd3adf9d9eecc3bbf8a98738734d3061347172
with:
PROJECT_FILE_PATH: ${{ github.workspace }}/src/NetSparkle.UI.WPF/NetSparkle.UI.WPF.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
# VERSION_REGEX: <Version>(.*)<\/Version> # Regex pattern to extract version info in a capturing group
TAG_COMMIT: false # Flag to enable / disalge git tagging
# TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version
NUGET_KEY: ${{secrets.NUGET_API_KEY}} # nuget.org API key
PACKAGE_NAME: NetSparkleUpdater.UI.WPF
INCLUDE_SYMBOLS: true
- name: Publish NetSparkleUpdater.UI.Avalonia on version change
uses: nitz/publish-nuget@60fd3adf9d9eecc3bbf8a98738734d3061347172
with:
PROJECT_FILE_PATH: ${{ github.workspace }}/src/NetSparkle.UI.Avalonia/NetSparkle.UI.Avalonia.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
# VERSION_REGEX: <Version>(.*)<\/Version> # Regex pattern to extract version info in a capturing group
TAG_COMMIT: false # Flag to enable / disalge git tagging
# TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version
NUGET_KEY: ${{secrets.NUGET_API_KEY}} # nuget.org API key
PACKAGE_NAME: NetSparkleUpdater.UI.Avalonia
INCLUDE_SYMBOLS: true
- name: Publish NetSparkleUpdater.UI.WinForms.NetCore on version change
uses: nitz/publish-nuget@60fd3adf9d9eecc3bbf8a98738734d3061347172
with:
PROJECT_FILE_PATH: ${{ github.workspace }}/src/NetSparkle.UI.WinForms.NetCore/NetSparkle.UI.WinForms.NetCore.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
# VERSION_REGEX: <Version>(.*)<\/Version> # Regex pattern to extract version info in a capturing group
TAG_COMMIT: false # Flag to enable / disalge git tagging
# TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version
NUGET_KEY: ${{secrets.NUGET_API_KEY}} # nuget.org API key
PACKAGE_NAME: NetSparkleUpdater.UI.WinForms.NetCore
INCLUDE_SYMBOLS: true
- name: Build NetSparkle.UI.WinForms.NetFramework in Release
run: msbuild ${{ github.workspace }}/src/NetSparkle.UI.WinForms.NetFramework/NetSparkle.UI.WinForms.NetFramework.csproj /property:Configuration=Release /p:OutputPath=../../nuget/winformsnetframework/lib/net452 /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg
- name: Setup NetSparkleUpdater.UI.WinForms.NetFramework folder
run: |
del ${{ github.workspace }}/nuget\winformsnetframework\lib\net452\NetSparkle.dll
del ${{ github.workspace }}/nuget\winformsnetframework\lib\net452\NetSparkle.pdb
copy ${{ github.workspace }}/LICENSE.md ${{ github.workspace }}/nuget\winformsnetframework\LICENSE.md
copy ${{ github.workspace }}/src\NetSparkle\ArtWork\software-update-available.png ${{ github.workspace }}/nuget\winformsnetframework\software-update-available.png
- name: Publish NetSparkleUpdater.UI.WinForms.NetFramework
run: |
cd ${{ github.workspace }}/nuget/winformsnetframework
nuget pack NetSparkleUpdater.UI.WinForms.NetFramework.nuspec -verbosity detailed -Symbols -SymbolPackageFormat snupkg
nuget push *.nupkg -Source https://www.nuget.org/api/v2/package -SkipDuplicate -verbosity detailed
cd ${{ github.workspace }}
- name: Publish NetSparkleUpdater.Tools.DSAHelper
uses: nitz/publish-nuget@60fd3adf9d9eecc3bbf8a98738734d3061347172
with:
PROJECT_FILE_PATH: ${{ github.workspace }}/src/NetSparkle.Tools.DSAHelper/NetSparkle.Tools.DSAHelper.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
# VERSION_REGEX: <Version>(.*)<\/Version> # Regex pattern to extract version info in a capturing group
TAG_COMMIT: false # Flag to enable / disalge git tagging
# TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version
NUGET_KEY: ${{secrets.NUGET_API_KEY}} # nuget.org API key
PACKAGE_NAME: NetSparkleUpdater.Tools.DSAHelper
INCLUDE_SYMBOLS: true
- name: Publish NetSparkleUpdater.Tools.AppCastGenerator
uses: nitz/publish-nuget@60fd3adf9d9eecc3bbf8a98738734d3061347172
with:
PROJECT_FILE_PATH: ${{ github.workspace }}/src/NetSparkle.Tools.AppCastGenerator/NetSparkle.Tools.AppCastGenerator.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
# VERSION_REGEX: <Version>(.*)<\/Version> # Regex pattern to extract version info in a capturing group
TAG_COMMIT: false # Flag to enable / disalge git tagging
# TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version
NUGET_KEY: ${{secrets.NUGET_API_KEY}} # nuget.org API key
PACKAGE_NAME: NetSparkleUpdater.Tools.AppCastGenerator
INCLUDE_SYMBOLS: true