From d6107e003f2882aec71499784e8418de21031c10 Mon Sep 17 00:00:00 2001 From: bezzad Date: Sat, 11 Nov 2023 23:39:34 +0330 Subject: [PATCH] updated docker files to support .Net 7.0 --- .github/workflows/dotnet-ubuntu.yml | 14 ++++++++++++++ .github/workflows/dotnet-windows.yml | 14 ++++++++++++++ src/docker-compose.yml | 2 +- src/dockerfile | 4 ++-- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet-ubuntu.yml b/.github/workflows/dotnet-ubuntu.yml index 41b5cbe..eef07d5 100644 --- a/.github/workflows/dotnet-ubuntu.yml +++ b/.github/workflows/dotnet-ubuntu.yml @@ -7,25 +7,39 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Setup .NET Core 3.1 uses: actions/setup-dotnet@v3 with: dotnet-version: 3.1.x + - name: Setup .NET Core 6.0 uses: actions/setup-dotnet@v3 with: dotnet-version: 6.0.x + + - name: Setup .NET Core 7.0 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + - name: Install Downloader Dependencies run: dotnet restore ./src/Downloader/Downloader.csproj + - name: Build Downloader Project run: dotnet build ./src/Downloader/Downloader.csproj + - name: Install Downloader.DummyHttpServer Dependencies run: dotnet restore ./src/Downloader.DummyHttpServer/Downloader.DummyHttpServer.csproj + - name: Build Downloader.DummyHttpServer Project run: dotnet build ./src/Downloader.DummyHttpServer/Downloader.DummyHttpServer.csproj + - name: Install Downloader.Test Dependencies run: dotnet restore ./src/Downloader.Test/Downloader.Test.csproj + - name: Build Downloader.Test Project run: dotnet build ./src/Downloader.Test/Downloader.Test.csproj + - name: Test run: dotnet test ./src/Downloader.Test/Downloader.Test.csproj --no-build --verbosity detailed \ No newline at end of file diff --git a/.github/workflows/dotnet-windows.yml b/.github/workflows/dotnet-windows.yml index e30d2bd..0b10df0 100644 --- a/.github/workflows/dotnet-windows.yml +++ b/.github/workflows/dotnet-windows.yml @@ -7,25 +7,39 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v3 + - name: Setup .NET Core 3.1 uses: actions/setup-dotnet@v3 with: dotnet-version: 3.1.x + - name: Setup .NET Core 6.0 uses: actions/setup-dotnet@v3 with: dotnet-version: 6.0.x + + - name: Setup .NET Core 7.0 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + - name: Install Downloader Dependencies run: dotnet restore ./src/Downloader/Downloader.csproj + - name: Build Downloader Project run: dotnet build ./src/Downloader/Downloader.csproj + - name: Install Downloader.DummyHttpServer Dependencies run: dotnet restore ./src/Downloader.DummyHttpServer/Downloader.DummyHttpServer.csproj + - name: Build Downloader.DummyHttpServer Project run: dotnet build ./src/Downloader.DummyHttpServer/Downloader.DummyHttpServer.csproj + - name: Install Downloader.Test Dependencies run: dotnet restore ./src/Downloader.Test/Downloader.Test.csproj + - name: Build Downloader.Test Project run: dotnet build ./src/Downloader.Test/Downloader.Test.csproj + - name: Test run: dotnet test ./src/Downloader.Test/Downloader.Test.csproj --no-build --verbosity detailed \ No newline at end of file diff --git a/src/docker-compose.yml b/src/docker-compose.yml index c2431eb..9253dcf 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -16,7 +16,7 @@ services: # container_name: downloader-win linux-net6: - image: mcr.microsoft.com/dotnet/sdk:6.0 + image: mcr.microsoft.com/dotnet/sdk:7.0 build: context: . dockerfile: ./dockerfile diff --git a/src/dockerfile b/src/dockerfile index 22ca19f..9535a7b 100644 --- a/src/dockerfile +++ b/src/dockerfile @@ -1,5 +1,5 @@ # Use the official Microsoft .NET 6 SDK image as the base image -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build # Set the working directory in the container WORKDIR /app @@ -9,7 +9,7 @@ COPY . ./ # Build the project RUN dotnet restore -RUN dotnet build --configuration Release --no-restore -verbosity:m -f net6.0 +RUN dotnet build --configuration Release --no-restore -verbosity:m -f net7.0 # Set the entrypoint ENTRYPOINT dotnet test --logger "console;verbosity=detailed" \ No newline at end of file