From 6bd125408e5496fbff8a12dba056468f2a164065 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Mon, 19 May 2025 13:09:40 +0800 Subject: [PATCH] :bug: Tryin' to fix build --- .github/workflows/docker-build.yml | 5 ++-- DysonNetwork.Sphere/.dockerignore | 1 - .../Account/RelationshipController.cs | 2 +- DysonNetwork.Sphere/Auth/Session.cs | 1 - DysonNetwork.Sphere/Developer/CustomApp.cs | 2 +- DysonNetwork.Sphere/Dockerfile | 11 ++++--- .../DysonNetwork.Sphere.csproj | 29 ++++++++++++------- DysonNetwork.Sphere/Permission/Permission.cs | 2 +- 8 files changed, 30 insertions(+), 23 deletions(-) delete mode 100644 DysonNetwork.Sphere/.dockerignore diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 1dcb8cc..1f4178e 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -24,9 +24,10 @@ jobs: username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} - name: Build and push Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: - context: DysonNetwork.Sphere + file: DysonNetwork.Sphere/Dockerfile + context: . push: true tags: xsheep2010/dyson-sphere:latest platforms: linux/amd64 diff --git a/DysonNetwork.Sphere/.dockerignore b/DysonNetwork.Sphere/.dockerignore deleted file mode 100644 index 3c3629e..0000000 --- a/DysonNetwork.Sphere/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/DysonNetwork.Sphere/Account/RelationshipController.cs b/DysonNetwork.Sphere/Account/RelationshipController.cs index 18c675d..127a8ff 100644 --- a/DysonNetwork.Sphere/Account/RelationshipController.cs +++ b/DysonNetwork.Sphere/Account/RelationshipController.cs @@ -1,6 +1,6 @@ +using System.ComponentModel.DataAnnotations; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Microsoft.Build.Framework; using Microsoft.EntityFrameworkCore; namespace DysonNetwork.Sphere.Account; diff --git a/DysonNetwork.Sphere/Auth/Session.cs b/DysonNetwork.Sphere/Auth/Session.cs index 1766887..60d2b4f 100644 --- a/DysonNetwork.Sphere/Auth/Session.cs +++ b/DysonNetwork.Sphere/Auth/Session.cs @@ -1,7 +1,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; -using Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Templates.BlazorIdentity.Pages; using NodaTime; using Point = NetTopologySuite.Geometries.Point; diff --git a/DysonNetwork.Sphere/Developer/CustomApp.cs b/DysonNetwork.Sphere/Developer/CustomApp.cs index cddf0e8..939de6a 100644 --- a/DysonNetwork.Sphere/Developer/CustomApp.cs +++ b/DysonNetwork.Sphere/Developer/CustomApp.cs @@ -1,5 +1,5 @@ using System.ComponentModel.DataAnnotations; -using Newtonsoft.Json; +using System.Text.Json.Serialization; using NodaTime; namespace DysonNetwork.Sphere.Developer; diff --git a/DysonNetwork.Sphere/Dockerfile b/DysonNetwork.Sphere/Dockerfile index 968050c..8ac5eb6 100644 --- a/DysonNetwork.Sphere/Dockerfile +++ b/DysonNetwork.Sphere/Dockerfile @@ -1,21 +1,20 @@ -FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base USER $APP_UID WORKDIR /app EXPOSE 8080 EXPOSE 8081 FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build -RUN apt-get update && apt-get install -y nodejs npm ARG BUILD_CONFIGURATION=Release WORKDIR /src -COPY ["DysonNetwork.Sphere.csproj", "."] -RUN dotnet restore "DysonNetwork.Sphere.csproj" COPY . . -RUN dotnet build "DysonNetwork.Sphere.csproj" -c $BUILD_CONFIGURATION -o /app/build +WORKDIR "/src/DysonNetwork.Sphere" +RUN dotnet restore +RUN dotnet build -c $BUILD_CONFIGURATION -o /app/build FROM build AS publish ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "DysonNetwork.Sphere.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false +RUN dotnet publish -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false FROM base AS final WORKDIR /app diff --git a/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj b/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj index c5c182a..b4e0431 100644 --- a/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj +++ b/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj @@ -19,9 +19,9 @@ - - - + + + @@ -40,7 +40,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -102,12 +101,12 @@ ResXFileCodeGenerator Email.LandingResource.Designer.cs - - SharedResource.resx - - - AccountEventResource.resx - + + + + + + @@ -133,4 +132,14 @@ + + <_ContentIncludedByDefault Remove="app\publish\appsettings.json" /> + <_ContentIncludedByDefault Remove="app\publish\DysonNetwork.Sphere.deps.json" /> + <_ContentIncludedByDefault Remove="app\publish\DysonNetwork.Sphere.runtimeconfig.json" /> + <_ContentIncludedByDefault Remove="app\publish\DysonNetwork.Sphere.staticwebassets.endpoints.json" /> + <_ContentIncludedByDefault Remove="app\publish\Keys\Solian.json" /> + <_ContentIncludedByDefault Remove="app\publish\package-lock.json" /> + <_ContentIncludedByDefault Remove="app\publish\package.json" /> + + diff --git a/DysonNetwork.Sphere/Permission/Permission.cs b/DysonNetwork.Sphere/Permission/Permission.cs index cc0aa94..fe68844 100644 --- a/DysonNetwork.Sphere/Permission/Permission.cs +++ b/DysonNetwork.Sphere/Permission/Permission.cs @@ -1,8 +1,8 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json; +using System.Text.Json.Serialization; using Microsoft.EntityFrameworkCore; -using Newtonsoft.Json; using NodaTime; namespace DysonNetwork.Sphere.Permission;