refactor: move project to src/ and add slnx
Some checks failed
Build and Deploy / build (push) Successful in 22s
Build and Deploy / docker (push) Successful in 26m23s
Build and Deploy / deploy (push) Failing after 3s

- Add YarpGateway.slnx solution file
- Move all project files to src/ directory
- Update Dockerfile for new src/ path structure
- Update CI/CD workflow with src/ project path
- Fix NuGet package references (use Gitea NuGet packages)
- Add CPM (Central Package Management) with Directory.Packages.props
This commit is contained in:
movingsam 2026-02-28 13:10:41 +08:00
parent ca2c0d69a2
commit 564d664426
42 changed files with 22 additions and 12 deletions

View File

@ -47,13 +47,13 @@ jobs:
NUGET NUGET
- name: Restore dependencies - name: Restore dependencies
run: dotnet restore run: dotnet restore src/YarpGateway.csproj
- name: Build - name: Build
run: dotnet build --configuration Release --no-restore run: dotnet build src/YarpGateway.csproj --configuration Release --no-restore
- name: Publish - name: Publish
run: dotnet publish --configuration Release --no-build --output ./publish run: dotnet publish src/YarpGateway.csproj --configuration Release --no-build --output ./publish
docker: docker:
needs: build needs: build

View File

@ -8,23 +8,23 @@ FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG BUILD_CONFIGURATION=Release ARG BUILD_CONFIGURATION=Release
WORKDIR /src WORKDIR /src
# Copy project files # Copy project files from src
COPY ["Directory.Packages.props", "./"] COPY ["src/Directory.Packages.props", "src/"]
COPY ["YarpGateway.csproj", "./"] COPY ["src/YarpGateway.csproj", "src/"]
COPY ["NuGet.Config", "./"] COPY ["src/NuGet.Config", "src/"]
# Restore dependencies # Restore dependencies
RUN dotnet restore "YarpGateway.csproj" RUN dotnet restore "src/YarpGateway.csproj"
# Copy all source code # Copy all source code
COPY . . COPY . .
WORKDIR "/src" WORKDIR "/src"
RUN dotnet build "YarpGateway.csproj" -c $BUILD_CONFIGURATION -o /app/build RUN dotnet build "src/YarpGateway.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish FROM build AS publish
ARG BUILD_CONFIGURATION=Release ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "YarpGateway.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false RUN dotnet publish "src/YarpGateway.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final FROM base AS final
WORKDIR /app WORKDIR /app

9
YarpGateway.slnx Normal file
View File

@ -0,0 +1,9 @@
<Solution>
<Folder Name="/items/">
<File Path=".gitea\workflows\docker.yml" />
<File Path="Dockerfile" />
</Folder>
<Folder Name="/src/">
<Project Path="src/YarpGateway.csproj" />
</Folder>
</Solution>

View File

@ -8,9 +8,10 @@
<PackageVersion Include="Fengling.ServiceDiscovery.Kubernetes" Version="1.0.0" /> <PackageVersion Include="Fengling.ServiceDiscovery.Kubernetes" Version="1.0.0" />
<PackageVersion Include="Fengling.ServiceDiscovery.Static" Version="1.0.0" /> <PackageVersion Include="Fengling.ServiceDiscovery.Static" Version="1.0.0" />
<!-- Microsoft Packages --> <!-- Microsoft Packages (aligned with fengling-console) -->
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.2" /> <PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.3" /> <PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.2" />
<!-- Database --> <!-- Database -->
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0" /> <PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0" />