Skip to content

Commit adf37f1

Browse files
Update template
1 parent 5f1b603 commit adf37f1

File tree

10 files changed

+144
-422
lines changed

10 files changed

+144
-422
lines changed

GitVersion.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
next-version: 1.0.0
21
mode: ContinuousDelivery
32
commit-message-incrementing: Disabled
4-
legacy-semver-padding: 0

build.cmd

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

build/build.cs

Lines changed: 50 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,68 +4,62 @@
44
using static Bullseye.Targets;
55
using static SimpleExec.Command;
66

7-
public class build
7+
var version = GetGitVersion();
8+
9+
Target("clean", () =>
810
{
9-
public static void Main(string[] args)
11+
Run("dotnet", "clean");
12+
13+
if (Directory.Exists("artifacts"))
1014
{
11-
var version = GetGitVersion();
12-
13-
Target("clean", () =>
14-
{
15-
Run("dotnet", "clean");
16-
17-
if (Directory.Exists("artifacts"))
18-
{
19-
Directory.Delete("artifacts", true);
20-
}
21-
});
22-
23-
Target("restore", DependsOn("clean"), () =>
24-
{
25-
Run("dotnet", "restore");
26-
});
27-
28-
Target("build", DependsOn("restore"), () =>
29-
{
30-
Run("dotnet", "build " +
31-
"--no-restore " +
32-
"--configuration Release " +
33-
$"/p:Version={version.SemVer} " +
34-
$"/p:AssemblyVersion={version.AssemblySemVer} " +
35-
$"/p:FileVersion={version.AssemblySemFileVer} " +
36-
$"/p:InformationalVersion={version.InformationalVersion}");
37-
});
38-
39-
Target("test", DependsOn("build"), () =>
40-
{
41-
Run("dotnet", "test --configuration Release --no-restore --no-build");
42-
});
43-
44-
Target("package", DependsOn("build", "test"), () =>
45-
{
46-
Run("dotnet", $"pack --configuration Release --no-restore --no-build --output artifacts /p:Version={version.SemVer}");
47-
});
48-
49-
Target("publish", DependsOn("package"), () =>
50-
{
51-
var apiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY");
52-
53-
Run("dotnet", $"nuget push {Path.Combine("artifacts", "*.nupkg")} --api-key {apiKey} --source https://api.nuget.org/v3/index.json");
54-
});
55-
56-
Target("default", DependsOn("package"));
57-
58-
RunTargetsAndExit(args);
15+
Directory.Delete("artifacts", true);
5916
}
17+
});
6018

61-
private static GitVersion GetGitVersion()
62-
{
63-
Run("dotnet", "tool restore");
19+
Target("restore", DependsOn("clean"), () =>
20+
{
21+
Run("dotnet", "restore");
22+
});
6423

65-
var value = Read("dotnet", "dotnet-gitversion");
24+
Target("build", DependsOn("restore"), () =>
25+
{
26+
Run("dotnet", "build " +
27+
"--no-restore " +
28+
"--configuration Release " +
29+
$"/p:Version={version.SemVer} " +
30+
$"/p:AssemblyVersion={version.AssemblySemVer} " +
31+
$"/p:FileVersion={version.AssemblySemFileVer} " +
32+
$"/p:InformationalVersion={version.InformationalVersion}");
33+
});
34+
35+
Target("test", DependsOn("build"), () =>
36+
{
37+
Run("dotnet", "test --configuration Release --no-restore --no-build");
38+
});
6639

67-
return JsonSerializer.Deserialize<GitVersion>(value);
68-
}
40+
Target("package", DependsOn("build", "test"), () =>
41+
{
42+
Run("dotnet", $"pack --configuration Release --no-restore --no-build --output artifacts /p:Version={version.SemVer}");
43+
});
44+
45+
Target("publish", DependsOn("package"), () =>
46+
{
47+
var apiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY");
48+
49+
Run("dotnet", $"nuget push {Path.Combine("artifacts", "*.nupkg")} --api-key {apiKey} --source https://api.nuget.org/v3/index.json");
50+
});
51+
52+
Target("default", DependsOn("package"));
53+
54+
RunTargetsAndExit(args);
55+
56+
GitVersion GetGitVersion()
57+
{
58+
Run("dotnet", "tool restore");
59+
60+
var value = Read("dotnet", "dotnet-gitversion");
61+
62+
return JsonSerializer.Deserialize<GitVersion>(value);
6963
}
7064

7165
public class GitVersion

build/build.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net50</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Bullseye" Version="3.4.0" />
10-
<PackageReference Include="SimpleExec" Version="6.2.0" />
11-
<PackageReference Include="System.Text.Json" Version="4.7.2" />
9+
<PackageReference Include="Bullseye" Version="3.7.0" />
10+
<PackageReference Include="SimpleExec" Version="6.4.0" />
11+
<PackageReference Include="System.Text.Json" Version="5.0.1" />
1212
</ItemGroup>
1313

1414
</Project>

src/Prefab/templates/prefab/.gitattributes

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

0 commit comments

Comments
 (0)