refactor: move project to src/ and add slnx
- 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:
parent
ca2c0d69a2
commit
564d664426
@ -47,13 +47,13 @@ jobs:
|
||||
NUGET
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
run: dotnet restore src/YarpGateway.csproj
|
||||
|
||||
- name: Build
|
||||
run: dotnet build --configuration Release --no-restore
|
||||
run: dotnet build src/YarpGateway.csproj --configuration Release --no-restore
|
||||
|
||||
- name: Publish
|
||||
run: dotnet publish --configuration Release --no-build --output ./publish
|
||||
run: dotnet publish src/YarpGateway.csproj --configuration Release --no-build --output ./publish
|
||||
|
||||
docker:
|
||||
needs: build
|
||||
|
||||
14
Dockerfile
14
Dockerfile
@ -8,23 +8,23 @@ FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
|
||||
# Copy project files
|
||||
COPY ["Directory.Packages.props", "./"]
|
||||
COPY ["YarpGateway.csproj", "./"]
|
||||
COPY ["NuGet.Config", "./"]
|
||||
# Copy project files from src
|
||||
COPY ["src/Directory.Packages.props", "src/"]
|
||||
COPY ["src/YarpGateway.csproj", "src/"]
|
||||
COPY ["src/NuGet.Config", "src/"]
|
||||
|
||||
# Restore dependencies
|
||||
RUN dotnet restore "YarpGateway.csproj"
|
||||
RUN dotnet restore "src/YarpGateway.csproj"
|
||||
|
||||
# Copy all source code
|
||||
COPY . .
|
||||
|
||||
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
|
||||
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
|
||||
WORKDIR /app
|
||||
|
||||
9
YarpGateway.slnx
Normal file
9
YarpGateway.slnx
Normal 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>
|
||||
@ -8,9 +8,10 @@
|
||||
<PackageVersion Include="Fengling.ServiceDiscovery.Kubernetes" 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.EntityFrameworkCore.Design" Version="10.0.3" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.2" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.2" />
|
||||
|
||||
<!-- Database -->
|
||||
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0" />
|
||||
Loading…
Reference in New Issue
Block a user