Skip to content

Commit

Permalink
Upgrade API TFM to .NET 8.
Browse files Browse the repository at this point in the history
  • Loading branch information
SonnyRR committed Nov 15, 2023
1 parent 62118ae commit 8c032db
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
with:
fetch-depth: 0

- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x.x

- name: Build API image with built-in container support
run: ./build.sh BuildApiImageWithBuiltInContainerSupport

Expand All @@ -43,6 +48,11 @@ jobs:
with:
fetch-depth: 0

- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x.x

- name: Build API image with Dockerfile
run: ./build.sh BuildApiImageWithDockerfile

Expand Down
4 changes: 2 additions & 2 deletions src/MagicEightBall.API/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["src/MagicEightBall.API/MagicEightBall.API.csproj", "MagicEightBall.API/"]
RUN dotnet restore "MagicEightBall.API/MagicEightBall.API.csproj"
Expand Down
7 changes: 3 additions & 4 deletions src/MagicEightBall.API/MagicEightBall.API.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ContainerBaseImage>mcr.microsoft.com/dotnet/aspnet:7.0</ContainerBaseImage>
<ContainerBaseImage>mcr.microsoft.com/dotnet/aspnet:8.0</ContainerBaseImage>
<ContainerImageName>magic-8-ball-api</ContainerImageName>
<ContainerImageTag>built-in</ContainerImageTag>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.13" />
<PackageReference Include="Microsoft.NET.Build.Containers" Version="7.0.403" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>

Expand Down

0 comments on commit 8c032db

Please sign in to comment.