Skip to content

Commit d8e8a2a

Browse files
authored
feat: update to .NET 10 (#595)
* feat: update to .NET 10 * wip
1 parent a49eb2f commit d8e8a2a

File tree

10 files changed

+16
-17
lines changed

10 files changed

+16
-17
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Install .NET Core
2929
uses: actions/setup-dotnet@v5
3030
with:
31-
dotnet-version: '9.0.x'
31+
dotnet-version: '10.0.x'
3232

3333
- name: Build & test (Release)
3434
run: dotnet test src -c Release --logger "console;verbosity=normal"

.github/workflows/tool.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install .NET Core
3131
uses: actions/setup-dotnet@v5
3232
with:
33-
dotnet-version: '9.0.x'
33+
dotnet-version: '10.0.x'
3434

3535
- name: Should Deploy?
3636
if: ${{ success() && github.event_name == 'push' }}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build
1+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build
22
ARG TARGETARCH
33
WORKDIR /app
44

@@ -22,7 +22,7 @@ COPY . ./
2222
RUN dotnet publish src/UnityNuGet.Server -a "$TARGETARCH" -c Release -o /app/src/out
2323

2424
# Build runtime image
25-
FROM mcr.microsoft.com/dotnet/aspnet:9.0
25+
FROM mcr.microsoft.com/dotnet/aspnet:10.0
2626
WORKDIR /app
2727
COPY --from=build /app/src/out .
2828
ENTRYPOINT ["dotnet", "UnityNuGet.Server.dll"]

src/UnityNuGet.Server.Tests/UnityNuGet.Server.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<IsPackable>false</IsPackable>
66
<IsPublishable>false</IsPublishable>
77
</PropertyGroup>

src/UnityNuGet.Server/EndpointRouteBuilderExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ private static void MapGetAll(this IEndpointRouteBuilder builder)
4040
}
4141

4242
NpmPackageListAllResponse? result = instance?.All();
43+
4344
return Results.Json(result, UnityNuGetJsonSerializerContext.Default);
4445
});
4546
}
@@ -54,6 +55,7 @@ private static void MapGetPackage(this IEndpointRouteBuilder builder)
5455
}
5556

5657
NpmPackage? package = instance?.GetPackage(id);
58+
5759
if (package == null)
5860
{
5961
return Results.Json(NpmError.NotFound, UnityNuGetJsonSerializerContext.Default);
@@ -73,6 +75,7 @@ private static void MapDownloadPackage(this IEndpointRouteBuilder builder)
7375
}
7476

7577
NpmPackage? package = instance?.GetPackage(id);
78+
7679
if (package == null)
7780
{
7881
return Results.Json(NpmError.NotFound, UnityNuGetJsonSerializerContext.Default);
@@ -84,6 +87,7 @@ private static void MapDownloadPackage(this IEndpointRouteBuilder builder)
8487
}
8588

8689
string? filePath = instance?.GetPackageFilePath(file);
90+
8791
if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath))
8892
{
8993
return Results.Json(NpmError.NotFound, UnityNuGetJsonSerializerContext.Default);
@@ -94,6 +98,7 @@ private static void MapDownloadPackage(this IEndpointRouteBuilder builder)
9498
{
9599
httpContext.Response.ContentType = "application/octet-stream";
96100
httpContext.Response.ContentLength = new FileInfo(filePath).Length;
101+
97102
return Results.Ok();
98103
}
99104
else
@@ -174,6 +179,7 @@ private static void MapStatus(this IEndpointRouteBuilder builder)
174179
string output = Template
175180
.Parse(text)
176181
.Render(templateContext);
182+
177183
await context.Response.WriteAsync(output);
178184
});
179185
}

src/UnityNuGet.Server/UnityNuGet.Server.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<UserSecretsId>1be0a769-8d75-4a27-99e0-128afcc0ffee</UserSecretsId>
66
<PublishAot>false</PublishAot>
77
</PropertyGroup>
@@ -13,9 +13,6 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Microsoft.Extensions.Options" />
17-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" />
18-
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" />
1916
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" />
2017
</ItemGroup>
2118

src/UnityNuGet.Tests/UnityNuGet.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<IsPackable>false</IsPackable>
66
<IsPublishable>false</IsPublishable>
77
</PropertyGroup>

src/UnityNuGet.Tool/UnityNuGet.Tool.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<InterceptorsNamespaces>$(InterceptorsNamespaces);Microsoft.Extensions.Configuration.Binder.SourceGeneration</InterceptorsNamespaces>
77
<PackAsTool>true</PackAsTool>
88
<ToolCommandName>unityNuGet</ToolCommandName>

src/UnityNuGet/UnityNuGet.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
5-
<Version>0.14.0</Version>
4+
<TargetFramework>net10.0</TargetFramework>
65
<IsAotCompatible>true</IsAotCompatible>
76
</PropertyGroup>
87

@@ -22,15 +21,12 @@
2221

2322
<ItemGroup>
2423
<PackageReference Include="ICSharpCode.Decompiler" />
25-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
26-
<PackageReference Include="Microsoft.Extensions.Options" />
2724
<PackageReference Include="Microsoft.NET.ILLink.Tasks" />
2825
<PackageReference Include="NuGet.PackageManagement" />
2926
<PackageReference Include="NUglify" />
3027
<PackageReference Include="Scriban" />
3128
<PackageReference Include="SharpZipLib" />
3229
<PackageReference Include="System.ComponentModel.Annotations" />
33-
<PackageReference Include="System.Linq.Async" />
3430
</ItemGroup>
3531

3632
</Project>

src/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": "9.0.100",
3+
"version": "10.0.100",
44
"rollForward": "latestMinor",
55
"allowPrerelease": false
66
}

0 commit comments

Comments
 (0)