Skip to content

Commit 4cd4478

Browse files
authored
Merge pull request #32 from SimCubeLtd/net7
Upgrade for net7
2 parents da2c81c + ee49556 commit 4cd4478

18 files changed

+85
-41
lines changed

.github/workflows/pull-requests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ jobs:
1616
- uses: actions/checkout@v3
1717
with:
1818
fetch-depth: 0
19-
19+
2020
- uses: actions/setup-dotnet@v3
2121
with:
22-
dotnet-version: '6.0.x'
22+
dotnet-version: '7.0.x'
2323
include-prerelease: false
2424

2525
- name: Build, Test and Pack
2626
run: |
2727
dotnet tool restore
28-
dotnet cake
28+
dotnet cake

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
- uses: actions/setup-dotnet@v3
2525
with:
26-
dotnet-version: '6.0.x'
26+
dotnet-version: '7.0.x'
2727
include-prerelease: false
2828

2929
- name: Build, Test and Pack

Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
<NoDefaultExcludes>true</NoDefaultExcludes>
1010
<ImplicitUsings>enable</ImplicitUsings>
1111
<Nullable>enable</Nullable>
12-
<TargetFramework>net6.0</TargetFramework>
12+
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
1313
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
14+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1415
</PropertyGroup>
1516

1617
<ItemGroup>

Directory.Packages.props

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project>
2+
<ItemGroup Label="Microsoft">
3+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
4+
</ItemGroup>
5+
<ItemGroup Label="PulumiPackages">
6+
<PackageVersion Include="Pulumi.AzureAD" Version="5.30.0" />
7+
<PackageVersion Include="Pulumi.Kubernetes" Version="3.22.1" />
8+
<PackageVersion Include="Pulumi.Command" Version="4.5.0" />
9+
<PackageVersion Include="Pulumi.AzureNative" Version="1.84.0" />
10+
<PackageVersion Include="Pulumi.Random" Version="4.8.2" />
11+
</ItemGroup>
12+
<ItemGroup Label="ThirdParty">
13+
<PackageVersion Include="FluentValidation" Version="11.2.2" />
14+
</ItemGroup>
15+
</Project>

SimCube.PulumiDeployments.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1414
dotnet-tools.json = dotnet-tools.json
1515
build.cake = build.cake
1616
LICENSE.md = LICENSE.md
17+
Directory.Packages.props = Directory.Packages.props
1718
EndProjectSection
1819
EndProject
1920
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHubActions", "GitHubActions", "{3D8DC738-1906-439A-9EC4-C063E1290F22}"

build.cake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Task("Build")
5252
{
5353
Configuration = configuration,
5454
NoRestore = true,
55-
ArgumentCustomization = args =>
55+
ArgumentCustomization = args =>
5656
args
5757
.Append($"-p:Version={version}")
5858
.Append($"-p:InformationalVersion={version}"),
@@ -66,7 +66,7 @@ Task("Pack")
6666
.Does(() =>
6767
{
6868
DotNetPack("src/SimCube.PulumiDeployments/SimCube.PulumiDeployments.csproj",
69-
new DotNetCorePackSettings()
69+
new DotNetPackSettings()
7070
{
7171
NoBuild = true,
7272
NoRestore = true,
@@ -83,4 +83,4 @@ Task("Default")
8383
.IsDependentOn("Build")
8484
.IsDependentOn("Pack");
8585

86-
RunTarget(target);
86+
RunTarget(target);

dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"cake.tool": {
6-
"version": "2.3.0",
6+
"version": "3.0.0",
77
"commands": [
88
"dotnet-cake"
99
]
@@ -15,4 +15,4 @@
1515
]
1616
}
1717
}
18-
}
18+
}

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "6.0.402",
3+
"version": "7.0.100",
44
"rollForward": "latestFeature",
55
"allowPrerelease": false
66
}

nuget.config

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
4+
<packageSources>
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6+
</packageSources>
7+
8+
<packageSourceMapping>
9+
<packageSource key="nuget.org">
10+
<package pattern="*" />
11+
</packageSource>
12+
</packageSourceMapping>
13+
14+
</configuration>

src/Directory.Build.props

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project>
2+
<Import Project="..\Directory.Build.props" />
3+
4+
<PropertyGroup>
5+
<IncludeSymbols>true</IncludeSymbols>
6+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
7+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
8+
<Nullable>enable</Nullable>
9+
<Feature>nullablePublicOnly</Feature>
10+
</PropertyGroup>
11+
12+
<ItemGroup Label="Microsoft">
13+
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
14+
</ItemGroup>
15+
16+
</Project>

src/SimCube.PulumiDeployments/Extensions/ConfigurationExtensions.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ public static class ConfigurationExtensions
55
{
66
public static T GetRequiredFromJson<T>(this Config config, string key)
77
{
8-
Guard.Against.Null(config, nameof(config));
9-
Guard.Against.Null(config, nameof(key));
8+
ArgumentNullException.ThrowIfNull(config, nameof(config));
9+
ArgumentNullException.ThrowIfNull(key, nameof(key));
1010

1111
var options = new JsonSerializerOptions();
1212
options.Converters.Add(new JsonStringEnumConverter());
@@ -15,8 +15,8 @@ public static T GetRequiredFromJson<T>(this Config config, string key)
1515

1616
public static T? GetOptionalFromJson<T>(this Config config, string key) where T : class
1717
{
18-
Guard.Against.Null(config, nameof(config));
19-
Guard.Against.Null(config, nameof(key));
18+
ArgumentNullException.ThrowIfNull(config, nameof(config));
19+
ArgumentNullException.ThrowIfNull(key, nameof(key));
2020

2121
var options = new JsonSerializerOptions();
2222
options.Converters.Add(new JsonStringEnumConverter());
@@ -26,8 +26,8 @@ public static T GetRequiredFromJson<T>(this Config config, string key)
2626

2727
public static string GetString(this Config config, string key)
2828
{
29-
Guard.Against.Null(config, nameof(config));
30-
Guard.Against.Null(config, nameof(key));
29+
ArgumentNullException.ThrowIfNull(config, nameof(config));
30+
ArgumentNullException.ThrowIfNull(key, nameof(key));
3131

3232
return config.Require(key);
3333
}
@@ -72,7 +72,7 @@ public static Dictionary<string, string> GetTags(
7272
this BaseAzureResourceArgs configuration,
7373
string location)
7474
{
75-
Guard.Against.Null(configuration, nameof(configuration));
75+
ArgumentNullException.ThrowIfNull(configuration, nameof(configuration));
7676

7777
return new()
7878
{

src/SimCube.PulumiDeployments/GlobalUsings.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
global using System.Text.Json;
77
global using System.Text.Json.Serialization;
88
global using System.Xml;
9-
global using Ardalis.GuardClauses;
109
global using FluentValidation;
1110
global using FluentValidation.Results;
1211
global using Pulumi;
@@ -17,7 +16,6 @@
1716
global using Pulumi.Kubernetes.Types.Inputs.Networking.V1;
1817
global using SimCube.PulumiDeployments.Arguments.Azure;
1918
global using SimCube.PulumiDeployments.Arguments.Azure.AppService;
20-
global using SimCube.PulumiDeployments.Arguments.Azure.PostgreSql;
2119
global using SimCube.PulumiDeployments.Arguments.Azure.PostgreSql.Instance;
2220
global using SimCube.PulumiDeployments.Arguments.Azure.Storage;
2321
global using SimCube.PulumiDeployments.Configuration;

src/SimCube.PulumiDeployments/Resources/Kubernetes/DeploymentResource.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ public sealed class DeploymentResource : ComponentResource
99
private DeploymentResource(NamespaceResource @namespace, string name, DeploymentConfiguration deploymentConfiguration, string defaultSelectorValue, List<EnvVarArgs>? envVariables = null, ComponentResourceOptions? options = null)
1010
: base(nameof(DeploymentResource), name, options)
1111
{
12-
Guard.Against.Null(deploymentConfiguration, nameof(deploymentConfiguration));
13-
Guard.Against.NullOrEmpty(defaultSelectorValue, nameof(defaultSelectorValue));
12+
13+
ArgumentNullException.ThrowIfNull(deploymentConfiguration, nameof(deploymentConfiguration));
14+
ArgumentNullException.ThrowIfNull(defaultSelectorValue, nameof(defaultSelectorValue));
1415

1516
var customResourceOptions = new CustomResourceOptions
1617
{
@@ -41,7 +42,7 @@ private DeploymentResource(NamespaceResource @namespace, string name, Deployment
4142

4243
public static DeploymentResource Create(NamespaceResource @namespace, string name, DeploymentConfiguration deploymentConfiguration, string defaultSelectorValue, List<EnvVarArgs>? envVariables = null, ComponentResourceOptions? componentResourceOptions = null)
4344
{
44-
Guard.Against.Null(deploymentConfiguration, nameof(deploymentConfiguration));
45+
ArgumentNullException.ThrowIfNull(deploymentConfiguration, nameof(deploymentConfiguration));
4546

4647
var deployment = new DeploymentResource(@namespace, name, deploymentConfiguration, defaultSelectorValue, envVariables, componentResourceOptions);
4748

src/SimCube.PulumiDeployments/Resources/Kubernetes/IngressResource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public sealed class IngressResource : ComponentResource
66
private IngressResource(NamespaceResource @namespace, string name, IngressConfiguration[] ingressConfiguration, string? serviceName, ComponentResourceOptions? options = null)
77
: base(nameof(IngressResource), name, options)
88
{
9-
Guard.Against.Null(ingressConfiguration, nameof(ingressConfiguration));
9+
ArgumentNullException.ThrowIfNull(ingressConfiguration, nameof(ingressConfiguration));
1010

1111
var customResourceOptions = new CustomResourceOptions
1212
{
@@ -50,8 +50,8 @@ private IngressResource(NamespaceResource @namespace, string name, IngressConfig
5050
public static IngressResource Create(NamespaceResource @namespace, string name, IngressConfiguration[] ingressConfiguration,
5151
string? serviceName = null, ComponentResourceOptions? componentResourceOptions = null)
5252
{
53-
Guard.Against.Null(ingressConfiguration, nameof(ingressConfiguration));
54-
Guard.Against.Null(@namespace, nameof(@namespace));
53+
ArgumentNullException.ThrowIfNull(ingressConfiguration, nameof(ingressConfiguration));
54+
ArgumentNullException.ThrowIfNull(@namespace, nameof(@namespace));
5555

5656
var ingress = new IngressResource(@namespace, name, ingressConfiguration, serviceName, componentResourceOptions);
5757

src/SimCube.PulumiDeployments/Resources/Kubernetes/NamespaceResource.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ private NamespaceResource(string namespaceName, ComponentResourceOptions? option
3737
/// <returns></returns>
3838
public static NamespaceResource Create(string namespaceName, ComponentResourceOptions componentResourceOptions)
3939
{
40-
Guard.Against.Null(componentResourceOptions, nameof(componentResourceOptions));
40+
ArgumentNullException.ThrowIfNull(componentResourceOptions, nameof(componentResourceOptions));
4141

4242
var @namespace = new NamespaceResource(namespaceName, componentResourceOptions);
4343

4444
componentResourceOptions.DependsOn.Add(@namespace.Namespace);
4545

4646
return @namespace;
4747
}
48-
}
48+
}

src/SimCube.PulumiDeployments/Resources/Kubernetes/PersistentVolumeClaimResource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ private PersistentVolumeClaimResource(
1111
ComponentResourceOptions? options = null)
1212
: base(nameof(PersistentVolumeClaimResource), claimName, options)
1313
{
14-
Guard.Against.Null(@namespace, nameof(@namespace));
14+
ArgumentNullException.ThrowIfNull(@namespace, nameof(@namespace));
1515

1616
var customResourceOptions = new CustomResourceOptions
1717
{
@@ -61,7 +61,7 @@ public static void CreatePvc(
6161
bool isReadWriteOnce = true,
6262
ComponentResourceOptions? options = null)
6363
{
64-
Guard.Against.Null(@namespace, nameof(@namespace));
64+
ArgumentNullException.ThrowIfNull(@namespace, nameof(@namespace));
6565

6666
_ = new PersistentVolumeClaimResource(
6767
@namespace,
@@ -71,4 +71,4 @@ public static void CreatePvc(
7171
isReadWriteOnce,
7272
options);
7373
}
74-
}
74+
}

src/SimCube.PulumiDeployments/Resources/Kubernetes/ServiceResource.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public sealed class ServiceResource : ComponentResource
66
private ServiceResource(NamespaceResource @namespace, string name, DeploymentConfiguration deploymentConfiguration, string defaultSelectorKeyValue, ComponentResourceOptions? options = null)
77
: base(nameof(ServiceResource), name, options)
88
{
9-
Guard.Against.Null(deploymentConfiguration, nameof(deploymentConfiguration));
9+
ArgumentNullException.ThrowIfNull(deploymentConfiguration, nameof(deploymentConfiguration));
1010

1111
var customResourceOptions = new CustomResourceOptions {DependsOn = new List<Resource> {@namespace,},};
1212

@@ -27,7 +27,7 @@ private ServiceResource(NamespaceResource @namespace, string name, DeploymentCon
2727

2828
public static ServiceResource Create(NamespaceResource @namespace, string name, DeploymentConfiguration deploymentConfiguration, string defaultSelectorKeyValue, ComponentResourceOptions? componentResourceOptions = null)
2929
{
30-
Guard.Against.Null(deploymentConfiguration, nameof(deploymentConfiguration));
30+
ArgumentNullException.ThrowIfNull(deploymentConfiguration, nameof(deploymentConfiguration));
3131

3232
var service = new ServiceResource(@namespace, name, deploymentConfiguration, defaultSelectorKeyValue, componentResourceOptions);
3333

src/SimCube.PulumiDeployments/SimCube.PulumiDeployments.csproj

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@
1010
<RepositoryUrl>https://github.com/SimCubeLtd/SimCube.PulumiDeployments.git</RepositoryUrl>
1111
<RepositoryType>Git</RepositoryType>
1212
<PackageTags>pulumi, kubernetes, helm, fluentvalidation</PackageTags>
13-
<PackageReleaseNotes>Initial Release, Very Opinionated.</PackageReleaseNotes>
1413
</PropertyGroup>
1514

1615
<ItemGroup>
17-
<PackageReference Include="Ardalis.GuardClauses" Version="4.0.1" />
18-
<PackageReference Include="FluentValidation" Version="11.2.2" />
19-
<PackageReference Include="Pulumi.AzureAD" Version="5.30.0" />
20-
<PackageReference Include="Pulumi.Kubernetes" Version="3.22.1" />
21-
<PackageReference Include="Pulumi.Command" Version="4.5.0" />
22-
<PackageReference Include="Pulumi.AzureNative" Version="1.84.0" />
23-
<PackageReference Include="Pulumi.Random" Version="4.8.2" />
16+
<PackageReference Include="FluentValidation" />
17+
<PackageReference Include="Pulumi.AzureAD" />
18+
<PackageReference Include="Pulumi.Kubernetes" />
19+
<PackageReference Include="Pulumi.Command" />
20+
<PackageReference Include="Pulumi.AzureNative" />
21+
<PackageReference Include="Pulumi.Random" />
2422
</ItemGroup>
2523

2624
<ItemGroup>

0 commit comments

Comments
 (0)