Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade for net7 #32

Merged
merged 2 commits into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: '7.0.x'
include-prerelease: false

- name: Build, Test and Pack
run: |
dotnet tool restore
dotnet cake
dotnet cake
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: '7.0.x'
include-prerelease: false

- name: Build, Test and Pack
Expand Down
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
<NoDefaultExcludes>true</NoDefaultExcludes>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>

<ItemGroup>
Expand Down
15 changes: 15 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project>
<ItemGroup Label="Microsoft">
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
</ItemGroup>
<ItemGroup Label="PulumiPackages">
<PackageVersion Include="Pulumi.AzureAD" Version="5.30.0" />
<PackageVersion Include="Pulumi.Kubernetes" Version="3.22.1" />
<PackageVersion Include="Pulumi.Command" Version="4.5.0" />
<PackageVersion Include="Pulumi.AzureNative" Version="1.84.0" />
<PackageVersion Include="Pulumi.Random" Version="4.8.2" />
</ItemGroup>
<ItemGroup Label="ThirdParty">
<PackageVersion Include="FluentValidation" Version="11.2.2" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions SimCube.PulumiDeployments.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
dotnet-tools.json = dotnet-tools.json
build.cake = build.cake
LICENSE.md = LICENSE.md
Directory.Packages.props = Directory.Packages.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHubActions", "GitHubActions", "{3D8DC738-1906-439A-9EC4-C063E1290F22}"
Expand Down
6 changes: 3 additions & 3 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Task("Build")
{
Configuration = configuration,
NoRestore = true,
ArgumentCustomization = args =>
ArgumentCustomization = args =>
args
.Append($"-p:Version={version}")
.Append($"-p:InformationalVersion={version}"),
Expand All @@ -66,7 +66,7 @@ Task("Pack")
.Does(() =>
{
DotNetPack("src/SimCube.PulumiDeployments/SimCube.PulumiDeployments.csproj",
new DotNetCorePackSettings()
new DotNetPackSettings()
{
NoBuild = true,
NoRestore = true,
Expand All @@ -83,4 +83,4 @@ Task("Default")
.IsDependentOn("Build")
.IsDependentOn("Pack");

RunTarget(target);
RunTarget(target);
4 changes: 2 additions & 2 deletions dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "2.3.0",
"version": "3.0.0",
"commands": [
"dotnet-cake"
]
Expand All @@ -15,4 +15,4 @@
]
}
}
}
}
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.402",
"version": "7.0.100",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down
14 changes: 14 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>

<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>

<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>

</configuration>
16 changes: 16 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project>
<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<Nullable>enable</Nullable>
<Feature>nullablePublicOnly</Feature>
</PropertyGroup>

<ItemGroup Label="Microsoft">
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ public static class ConfigurationExtensions
{
public static T GetRequiredFromJson<T>(this Config config, string key)
{
Guard.Against.Null(config, nameof(config));
Guard.Against.Null(config, nameof(key));
ArgumentNullException.ThrowIfNull(config, nameof(config));
ArgumentNullException.ThrowIfNull(key, nameof(key));

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

public static T? GetOptionalFromJson<T>(this Config config, string key) where T : class
{
Guard.Against.Null(config, nameof(config));
Guard.Against.Null(config, nameof(key));
ArgumentNullException.ThrowIfNull(config, nameof(config));
ArgumentNullException.ThrowIfNull(key, nameof(key));

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

public static string GetString(this Config config, string key)
{
Guard.Against.Null(config, nameof(config));
Guard.Against.Null(config, nameof(key));
ArgumentNullException.ThrowIfNull(config, nameof(config));
ArgumentNullException.ThrowIfNull(key, nameof(key));

return config.Require(key);
}
Expand Down Expand Up @@ -72,7 +72,7 @@ public static Dictionary<string, string> GetTags(
this BaseAzureResourceArgs configuration,
string location)
{
Guard.Against.Null(configuration, nameof(configuration));
ArgumentNullException.ThrowIfNull(configuration, nameof(configuration));

return new()
{
Expand Down
2 changes: 0 additions & 2 deletions src/SimCube.PulumiDeployments/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
global using System.Text.Json;
global using System.Text.Json.Serialization;
global using System.Xml;
global using Ardalis.GuardClauses;
global using FluentValidation;
global using FluentValidation.Results;
global using Pulumi;
Expand All @@ -17,7 +16,6 @@
global using Pulumi.Kubernetes.Types.Inputs.Networking.V1;
global using SimCube.PulumiDeployments.Arguments.Azure;
global using SimCube.PulumiDeployments.Arguments.Azure.AppService;
global using SimCube.PulumiDeployments.Arguments.Azure.PostgreSql;
global using SimCube.PulumiDeployments.Arguments.Azure.PostgreSql.Instance;
global using SimCube.PulumiDeployments.Arguments.Azure.Storage;
global using SimCube.PulumiDeployments.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ public sealed class DeploymentResource : ComponentResource
private DeploymentResource(NamespaceResource @namespace, string name, DeploymentConfiguration deploymentConfiguration, string defaultSelectorValue, List<EnvVarArgs>? envVariables = null, ComponentResourceOptions? options = null)
: base(nameof(DeploymentResource), name, options)
{
Guard.Against.Null(deploymentConfiguration, nameof(deploymentConfiguration));
Guard.Against.NullOrEmpty(defaultSelectorValue, nameof(defaultSelectorValue));

ArgumentNullException.ThrowIfNull(deploymentConfiguration, nameof(deploymentConfiguration));
ArgumentNullException.ThrowIfNull(defaultSelectorValue, nameof(defaultSelectorValue));

var customResourceOptions = new CustomResourceOptions
{
Expand Down Expand Up @@ -41,7 +42,7 @@ private DeploymentResource(NamespaceResource @namespace, string name, Deployment

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public sealed class IngressResource : ComponentResource
private IngressResource(NamespaceResource @namespace, string name, IngressConfiguration[] ingressConfiguration, string? serviceName, ComponentResourceOptions? options = null)
: base(nameof(IngressResource), name, options)
{
Guard.Against.Null(ingressConfiguration, nameof(ingressConfiguration));
ArgumentNullException.ThrowIfNull(ingressConfiguration, nameof(ingressConfiguration));

var customResourceOptions = new CustomResourceOptions
{
Expand Down Expand Up @@ -50,8 +50,8 @@ private IngressResource(NamespaceResource @namespace, string name, IngressConfig
public static IngressResource Create(NamespaceResource @namespace, string name, IngressConfiguration[] ingressConfiguration,
string? serviceName = null, ComponentResourceOptions? componentResourceOptions = null)
{
Guard.Against.Null(ingressConfiguration, nameof(ingressConfiguration));
Guard.Against.Null(@namespace, nameof(@namespace));
ArgumentNullException.ThrowIfNull(ingressConfiguration, nameof(ingressConfiguration));
ArgumentNullException.ThrowIfNull(@namespace, nameof(@namespace));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ private NamespaceResource(string namespaceName, ComponentResourceOptions? option
/// <returns></returns>
public static NamespaceResource Create(string namespaceName, ComponentResourceOptions componentResourceOptions)
{
Guard.Against.Null(componentResourceOptions, nameof(componentResourceOptions));
ArgumentNullException.ThrowIfNull(componentResourceOptions, nameof(componentResourceOptions));

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

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

return @namespace;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ private PersistentVolumeClaimResource(
ComponentResourceOptions? options = null)
: base(nameof(PersistentVolumeClaimResource), claimName, options)
{
Guard.Against.Null(@namespace, nameof(@namespace));
ArgumentNullException.ThrowIfNull(@namespace, nameof(@namespace));

var customResourceOptions = new CustomResourceOptions
{
Expand Down Expand Up @@ -61,7 +61,7 @@ public static void CreatePvc(
bool isReadWriteOnce = true,
ComponentResourceOptions? options = null)
{
Guard.Against.Null(@namespace, nameof(@namespace));
ArgumentNullException.ThrowIfNull(@namespace, nameof(@namespace));

_ = new PersistentVolumeClaimResource(
@namespace,
Expand All @@ -71,4 +71,4 @@ public static void CreatePvc(
isReadWriteOnce,
options);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public sealed class ServiceResource : ComponentResource
private ServiceResource(NamespaceResource @namespace, string name, DeploymentConfiguration deploymentConfiguration, string defaultSelectorKeyValue, ComponentResourceOptions? options = null)
: base(nameof(ServiceResource), name, options)
{
Guard.Against.Null(deploymentConfiguration, nameof(deploymentConfiguration));
ArgumentNullException.ThrowIfNull(deploymentConfiguration, nameof(deploymentConfiguration));

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

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

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

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

Expand Down
14 changes: 6 additions & 8 deletions src/SimCube.PulumiDeployments/SimCube.PulumiDeployments.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@
<RepositoryUrl>https://github.com/SimCubeLtd/SimCube.PulumiDeployments.git</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>pulumi, kubernetes, helm, fluentvalidation</PackageTags>
<PackageReleaseNotes>Initial Release, Very Opinionated.</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Ardalis.GuardClauses" Version="4.0.1" />
<PackageReference Include="FluentValidation" Version="11.2.2" />
<PackageReference Include="Pulumi.AzureAD" Version="5.30.0" />
<PackageReference Include="Pulumi.Kubernetes" Version="3.22.1" />
<PackageReference Include="Pulumi.Command" Version="4.5.0" />
<PackageReference Include="Pulumi.AzureNative" Version="1.84.0" />
<PackageReference Include="Pulumi.Random" Version="4.8.2" />
<PackageReference Include="FluentValidation" />
<PackageReference Include="Pulumi.AzureAD" />
<PackageReference Include="Pulumi.Kubernetes" />
<PackageReference Include="Pulumi.Command" />
<PackageReference Include="Pulumi.AzureNative" />
<PackageReference Include="Pulumi.Random" />
</ItemGroup>

<ItemGroup>
Expand Down