Skip to content

Commit 49c01ae

Browse files
committed
Merge branch 'support/5.x' into main
2 parents 9e71251 + 0423197 commit 49c01ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1292
-735
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false
155155
csharp_space_between_parentheses = false
156156
csharp_space_between_square_brackets = false
157157

158+
# Alignment
159+
align_multiline_parameter = true
160+
161+
# Qualify fields with "this."
162+
csharp_instance_members_qualify_members = field
163+
158164
# IDE0011: Add braces
159165
dotnet_diagnostic.IDE0011.severity = none
160166

.github/workflows/ci.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
-
4747
name: Cache cake frosting
4848
id: cache-cake
49-
uses: actions/cache@v2.1.7
49+
uses: actions/cache@v3.0.2
5050
with:
5151
path: run
5252
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
@@ -78,14 +78,14 @@ jobs:
7878
-
7979
name: Use cached cake frosting
8080
id: cache-cake
81-
uses: actions/cache@v2.1.7
81+
uses: actions/cache@v3.0.2
8282
with:
8383
path: run
8484
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
8585
-
8686
name: Use cached tools
8787
id: cache-tools
88-
uses: actions/cache@v2.1.7
88+
uses: actions/cache@v3.0.2
8989
with:
9090
path: tools
9191
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
@@ -141,14 +141,14 @@ jobs:
141141
-
142142
name: Use cached cake frosting
143143
id: cache-cake
144-
uses: actions/cache@v2.1.7
144+
uses: actions/cache@v3.0.2
145145
with:
146146
path: run
147147
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
148148
-
149149
name: Use cached tools
150150
id: cache-tools
151-
uses: actions/cache@v2.1.7
151+
uses: actions/cache@v3.0.2
152152
with:
153153
path: tools
154154
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
@@ -180,14 +180,14 @@ jobs:
180180
-
181181
name: Use cached cake frosting
182182
id: cache-cake
183-
uses: actions/cache@v2.1.7
183+
uses: actions/cache@v3.0.2
184184
with:
185185
path: run
186186
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
187187
-
188188
name: Use cached tools
189189
id: cache-tools
190-
uses: actions/cache@v2.1.7
190+
uses: actions/cache@v3.0.2
191191
with:
192192
path: tools
193193
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
@@ -226,14 +226,14 @@ jobs:
226226
-
227227
name: Use cached cake frosting
228228
id: cache-cake
229-
uses: actions/cache@v2.1.7
229+
uses: actions/cache@v3.0.2
230230
with:
231231
path: run
232232
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
233233
-
234234
name: Use cached tools
235235
id: cache-tools
236-
uses: actions/cache@v2.1.7
236+
uses: actions/cache@v3.0.2
237237
with:
238238
path: tools
239239
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
@@ -290,14 +290,14 @@ jobs:
290290
-
291291
name: Use cached cake frosting
292292
id: cache-cake
293-
uses: actions/cache@v2.1.7
293+
uses: actions/cache@v3.0.2
294294
with:
295295
path: run
296296
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
297297
-
298298
name: Use cached tools
299299
id: cache-tools
300-
uses: actions/cache@v2.1.7
300+
uses: actions/cache@v3.0.2
301301
with:
302302
path: tools
303303
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
@@ -322,48 +322,48 @@ jobs:
322322
dotnet-version: '6.0.x'
323323
-
324324
name: Login to DockerHub
325-
if: success() && github.event_name != 'pull_request'
325+
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
326326
uses: docker/login-action@v1
327327
with:
328328
username: ${{ secrets.DOCKER_USERNAME }}
329329
password: ${{ secrets.DOCKER_PASSWORD }}
330330
-
331331
name: '[Docker Build/Test/Publish (amd64)] DockerHub'
332-
if: success() && github.event_name != 'pull_request'
332+
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
333333
shell: pwsh
334334
run: dotnet run/docker.dll --target=DockerPublish --arch amd64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry dockerhub
335335
-
336336
name: '[Docker Build/Test/Publish (arm64)] DockerHub'
337-
if: success() && github.event_name != 'pull_request'
337+
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
338338
shell: pwsh
339339
run: dotnet run/docker.dll --target=DockerPublish --arch arm64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry dockerhub
340340
-
341341
name: '[Docker Publish Manifest] DockerHub'
342-
if: success() && github.event_name != 'pull_request'
342+
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
343343
shell: pwsh
344344
run: dotnet run/docker.dll --target=DockerManifest --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry dockerhub
345345

346346
-
347347
name: Login to GitHub Container Registry
348-
if: success() && github.event_name != 'pull_request' && github.repository == 'GitTools/GitVersion'
348+
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
349349
uses: docker/login-action@v1
350350
with:
351351
registry: ghcr.io
352352
username: ${{ github.repository_owner }}
353353
password: ${{ secrets.DOCKER_GITHUB_TOKEN }}
354354
-
355355
name: '[Docker Build/Test/Publish (amd64)] GitHub Container Registry'
356-
if: success() && github.event_name != 'pull_request' && github.repository == 'GitTools/GitVersion'
356+
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
357357
shell: pwsh
358358
run: dotnet run/docker.dll --target=DockerPublish --arch amd64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry github
359359
-
360360
name: '[Docker Build/Test/Publish (arm64)] GitHub Container Registry'
361-
if: success() && github.event_name != 'pull_request' && github.repository == 'GitTools/GitVersion'
361+
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
362362
shell: pwsh
363363
run: dotnet run/docker.dll --target=DockerPublish --arch arm64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry github
364364
-
365365
name: '[Docker Publish Manifest] GitHub Container Registry'
366-
if: success() && github.event_name != 'pull_request' && github.repository == 'GitTools/GitVersion'
366+
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools'
367367
shell: pwsh
368368
run: dotnet run/docker.dll --target=DockerManifest --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry github
369369

@@ -388,14 +388,14 @@ jobs:
388388
-
389389
name: Use cached cake frosting
390390
id: cache-cake
391-
uses: actions/cache@v2.1.7
391+
uses: actions/cache@v3.0.2
392392
with:
393393
path: run
394394
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
395395
-
396396
name: Use cached tools
397397
id: cache-tools
398-
uses: actions/cache@v2.1.7
398+
uses: actions/cache@v3.0.2
399399
with:
400400
path: tools
401401
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
@@ -430,14 +430,14 @@ jobs:
430430
-
431431
name: Use cached cake frosting
432432
id: cache-cake
433-
uses: actions/cache@v2.1.7
433+
uses: actions/cache@v3.0.2
434434
with:
435435
path: run
436436
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
437437
-
438438
name: Use cached tools
439439
id: cache-tools
440-
uses: actions/cache@v2.1.7
440+
uses: actions/cache@v3.0.2
441441
with:
442442
path: tools
443443
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
-
4646
name: Cache cake frosting
4747
id: cache-cake
48-
uses: actions/cache@v2.1.7
48+
uses: actions/cache@v3.0.2
4949
with:
5050
path: run
5151
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}

.github/workflows/docs.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ jobs:
4545
-
4646
name: Cache cake frosting
4747
id: cache-cake
48-
uses: actions/cache@v2.1.7
48+
uses: actions/cache@v3.0.2
4949
with:
5050
path: run
5151
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
5252
-
5353
name: Use cached tools
5454
id: cache-tools
55-
uses: actions/cache@v2.1.7
55+
uses: actions/cache@v3.0.2
5656
with:
5757
path: tools
5858
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
@@ -63,7 +63,7 @@ jobs:
6363
-
6464
name: Cache Node Modules
6565
id: cache-node
66-
uses: actions/cache@v2.1.7
66+
uses: actions/cache@v3.0.2
6767
with:
6868
path: ${{ steps.cache-node-dir.outputs.dir }}
6969
key: node-${{ runner.os }}-${{ hashFiles('./package-lock.json') }}
@@ -91,14 +91,14 @@ jobs:
9191
-
9292
name: Use cached cake frosting
9393
id: cache-cake
94-
uses: actions/cache@v2.1.7
94+
uses: actions/cache@v3.0.2
9595
with:
9696
path: run
9797
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
9898
-
9999
name: Use cached tools
100100
id: cache-tools
101-
uses: actions/cache@v2.1.7
101+
uses: actions/cache@v3.0.2
102102
with:
103103
path: tools
104104
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
@@ -127,7 +127,7 @@ jobs:
127127
if_false: github-check
128128
-
129129
name: '[Remark Lint]'
130-
uses: reviewdog/action-remark-lint@v5.3
130+
uses: reviewdog/action-remark-lint@v5.4
131131
with:
132132
github_token: ${{ secrets.GITHUB_TOKEN }}
133133
reporter: ${{ steps.reporter.outputs.value }}
@@ -148,14 +148,14 @@ jobs:
148148
-
149149
name: Use cached cake frosting
150150
id: cache-cake
151-
uses: actions/cache@v2.1.7
151+
uses: actions/cache@v3.0.2
152152
with:
153153
path: run
154154
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
155155
-
156156
name: Use cached tools
157157
id: cache-tools
158-
uses: actions/cache@v2.1.7
158+
uses: actions/cache@v3.0.2
159159
with:
160160
path: tools
161161
key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}

build/Directory.Packages.props

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<Project>
22
<ItemGroup>
3-
<PackageReference Include="Cake.Common" Version="2.1.0" />
3+
<PackageReference Include="Cake.Common" Version="2.2.0" />
44
<PackageReference Include="Cake.Compression" Version="0.2.6" />
5-
<PackageReference Include="Cake.Frosting" Version="2.1.0" />
5+
<PackageReference Include="Cake.Frosting" Version="2.2.0" />
66
<PackageReference Include="Cake.Incubator" Version="7.0.0" />
7+
<PackageReference Include="Cake.DotNetLocalTools.Module" Version="1.0.2" />
78

8-
<PackageReference Include="Cake.Docker" Version="1.1.1" />
9+
<PackageReference Include="Cake.Docker" Version="1.1.2" />
910

1011
</ItemGroup>
1112
</Project>

build/artifacts/Program.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
using Artifacts;
2+
using Common.Lifetime;
3+
using Common.Utilities;
24

35
return new CakeHost()
46
.UseContext<BuildContext>()
5-
.UseStartup<Startup>()
7+
.UseLifetime<BuildLifetime>()
8+
.UseTaskLifetime<BuildTaskLifetime>()
9+
.UseRootDirectory()
10+
.InstallToolsFromRootManifest()
611
.Run(args);

build/artifacts/Startup.cs

Lines changed: 0 additions & 18 deletions
This file was deleted.

build/build/Program.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
using Build;
2+
using Common.Lifetime;
3+
using Common.Utilities;
24

35
return new CakeHost()
46
.UseContext<BuildContext>()
5-
.UseStartup<Startup>()
7+
.UseLifetime<BuildLifetime>()
8+
.UseTaskLifetime<BuildTaskLifetime>()
9+
.UseRootDirectory()
10+
.InstallToolsFromRootManifest()
11+
.InstallNugetTool(Tools.NugetCmd, Tools.Versions[Tools.NugetCmd])
612
.Run(args);

build/build/Startup.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using Cake.DotNetLocalTools.Module;
2+
3+
namespace Common.Utilities;
4+
5+
public static class ServicesExtensions
6+
{
7+
public static CakeHost UseRootDirectory(this CakeHost host)
8+
{
9+
host = host.ConfigureServices(services => services.UseWorkingDirectory(Extensions.GetRootDirectory()));
10+
return host;
11+
}
12+
13+
public static CakeHost InstallToolsFromRootManifest(this CakeHost host)
14+
{
15+
host = host.UseModule<LocalToolsModule>().InstallToolsFromManifest(Extensions.GetRootDirectory().CombineWithFilePath("dotnet-tools.json").FullPath);
16+
return host;
17+
}
18+
19+
public static CakeHost InstallNugetTool(this CakeHost host, string toolName, string toolVersion)
20+
{
21+
var toolUrl = new Uri($"nuget:?package={toolName}&version={toolVersion}");
22+
return host.ConfigureServices(services => services.UseTool(toolUrl));
23+
}
24+
}

0 commit comments

Comments
 (0)