From 00be9b6faf82744f3e52801b62d2948a78684024 Mon Sep 17 00:00:00 2001 From: Michael Fyffe <6224270+TraGicCode@users.noreply.github.com> Date: Sun, 30 Nov 2025 23:12:05 -0600 Subject: [PATCH] Prevent using SingleFileBuilds --- .github/workflows/dotnet_selfcontained.yml | 3 ++- src/BuslyCLI.Console/Dockerfile | 14 +++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dotnet_selfcontained.yml b/.github/workflows/dotnet_selfcontained.yml index b0bf35a..ca55e85 100644 --- a/.github/workflows/dotnet_selfcontained.yml +++ b/.github/workflows/dotnet_selfcontained.yml @@ -37,7 +37,8 @@ jobs: --runtime ${{ matrix.os }} \ --self-contained true \ --output ./artifacts/binaries/${{ matrix.os }} \ - /p:PublishSingleFile=true + --no-restore \ + -p:InformationalVersion=${{ steps.version.outputs.version }} - name: Create Archive run: | diff --git a/src/BuslyCLI.Console/Dockerfile b/src/BuslyCLI.Console/Dockerfile index 65b9f62..4652d44 100644 --- a/src/BuslyCLI.Console/Dockerfile +++ b/src/BuslyCLI.Console/Dockerfile @@ -9,21 +9,17 @@ COPY Directory.Build.props ./ # Copy project file and restore dependencies (better layer caching) COPY src/BuslyCLI.Console/BuslyCLI.Console.csproj ./BuslyCLI.Console/ RUN dotnet restore "BuslyCLI.Console/BuslyCLI.Console.csproj" \ - -r linux-musl-x64 + --runtime linux-musl-x64 # Copy source code and build COPY src/BuslyCLI.Console/ ./BuslyCLI.Console/ RUN dotnet publish "./BuslyCLI.Console/BuslyCLI.Console.csproj" \ - -c Release \ - -r linux-musl-x64 \ - -o /app/publish \ + --configuration Release \ + --runtime linux-musl-x64 \ + --self-contained true \ + --output /app/publish \ --no-restore \ - -p:PublishSingleFile=true \ - -p:PublishTrimmed=true \ - -p:TrimMode=partial \ - -p:EnableCompressionInSingleFile=true \ - -p:SelfContained=true \ -p:InformationalVersion=$APP_VERSION # Use minimal runtime for smaller image size