diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 200c128..9051034 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: - name: Install .NET Core uses: actions/setup-dotnet@v5 with: - dotnet-version: '9.0.x' + dotnet-version: '10.0.x' - name: Build & test (Release) run: dotnet test src -c Release --logger "console;verbosity=normal" diff --git a/.github/workflows/tool.yml b/.github/workflows/tool.yml index 1335b70..89ffc00 100644 --- a/.github/workflows/tool.yml +++ b/.github/workflows/tool.yml @@ -30,7 +30,7 @@ jobs: - name: Install .NET Core uses: actions/setup-dotnet@v5 with: - dotnet-version: '9.0.x' + dotnet-version: '10.0.x' - name: Should Deploy? if: ${{ success() && github.event_name == 'push' }} diff --git a/Dockerfile b/Dockerfile index 74926ba..642aee2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build ARG TARGETARCH WORKDIR /app @@ -22,7 +22,7 @@ COPY . ./ RUN dotnet publish src/UnityNuGet.Server -a "$TARGETARCH" -c Release -o /app/src/out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:9.0 +FROM mcr.microsoft.com/dotnet/aspnet:10.0 WORKDIR /app COPY --from=build /app/src/out . ENTRYPOINT ["dotnet", "UnityNuGet.Server.dll"] diff --git a/src/UnityNuGet.Server.Tests/UnityNuGet.Server.Tests.csproj b/src/UnityNuGet.Server.Tests/UnityNuGet.Server.Tests.csproj index a806865..9e13336 100644 --- a/src/UnityNuGet.Server.Tests/UnityNuGet.Server.Tests.csproj +++ b/src/UnityNuGet.Server.Tests/UnityNuGet.Server.Tests.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 false false diff --git a/src/UnityNuGet.Server/EndpointRouteBuilderExtensions.cs b/src/UnityNuGet.Server/EndpointRouteBuilderExtensions.cs index 99ca813..b5eea95 100644 --- a/src/UnityNuGet.Server/EndpointRouteBuilderExtensions.cs +++ b/src/UnityNuGet.Server/EndpointRouteBuilderExtensions.cs @@ -40,6 +40,7 @@ private static void MapGetAll(this IEndpointRouteBuilder builder) } NpmPackageListAllResponse? result = instance?.All(); + return Results.Json(result, UnityNuGetJsonSerializerContext.Default); }); } @@ -54,6 +55,7 @@ private static void MapGetPackage(this IEndpointRouteBuilder builder) } NpmPackage? package = instance?.GetPackage(id); + if (package == null) { return Results.Json(NpmError.NotFound, UnityNuGetJsonSerializerContext.Default); @@ -73,6 +75,7 @@ private static void MapDownloadPackage(this IEndpointRouteBuilder builder) } NpmPackage? package = instance?.GetPackage(id); + if (package == null) { return Results.Json(NpmError.NotFound, UnityNuGetJsonSerializerContext.Default); @@ -84,6 +87,7 @@ private static void MapDownloadPackage(this IEndpointRouteBuilder builder) } string? filePath = instance?.GetPackageFilePath(file); + if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath)) { return Results.Json(NpmError.NotFound, UnityNuGetJsonSerializerContext.Default); @@ -94,6 +98,7 @@ private static void MapDownloadPackage(this IEndpointRouteBuilder builder) { httpContext.Response.ContentType = "application/octet-stream"; httpContext.Response.ContentLength = new FileInfo(filePath).Length; + return Results.Ok(); } else @@ -174,6 +179,7 @@ private static void MapStatus(this IEndpointRouteBuilder builder) string output = Template .Parse(text) .Render(templateContext); + await context.Response.WriteAsync(output); }); } diff --git a/src/UnityNuGet.Server/UnityNuGet.Server.csproj b/src/UnityNuGet.Server/UnityNuGet.Server.csproj index 2632111..9414150 100644 --- a/src/UnityNuGet.Server/UnityNuGet.Server.csproj +++ b/src/UnityNuGet.Server/UnityNuGet.Server.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 1be0a769-8d75-4a27-99e0-128afcc0ffee false @@ -13,9 +13,6 @@ - - - diff --git a/src/UnityNuGet.Tests/UnityNuGet.Tests.csproj b/src/UnityNuGet.Tests/UnityNuGet.Tests.csproj index d2f23c2..84fbfc8 100644 --- a/src/UnityNuGet.Tests/UnityNuGet.Tests.csproj +++ b/src/UnityNuGet.Tests/UnityNuGet.Tests.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 false false diff --git a/src/UnityNuGet.Tool/UnityNuGet.Tool.csproj b/src/UnityNuGet.Tool/UnityNuGet.Tool.csproj index 21bca78..c1a8cb8 100644 --- a/src/UnityNuGet.Tool/UnityNuGet.Tool.csproj +++ b/src/UnityNuGet.Tool/UnityNuGet.Tool.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 $(InterceptorsNamespaces);Microsoft.Extensions.Configuration.Binder.SourceGeneration true unityNuGet diff --git a/src/UnityNuGet/UnityNuGet.csproj b/src/UnityNuGet/UnityNuGet.csproj index 5275949..299ef0c 100644 --- a/src/UnityNuGet/UnityNuGet.csproj +++ b/src/UnityNuGet/UnityNuGet.csproj @@ -1,8 +1,7 @@  - net9.0 - 0.14.0 + net10.0 true @@ -22,15 +21,12 @@ - - - diff --git a/src/global.json b/src/global.json index 680789c..60a2a83 100644 --- a/src/global.json +++ b/src/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.100", + "version": "10.0.100", "rollForward": "latestMinor", "allowPrerelease": false }