Skip to content

Commit

Permalink
Add support for net9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienros committed Aug 16, 2024
1 parent 6347ef1 commit fe5a020
Show file tree
Hide file tree
Showing 29 changed files with 109 additions and 73 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/functional_all_db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- uses: actions/setup-node@v4
with:
node-version: "15"
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/mac_unit_test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
name: Unit Tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Build and test
run: |
dotnet build -c Release -warnaserror /p:TreatWarningsAsErrors=true /p:RunAnalyzers=true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
node-version: "15"
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Build
# See pr_ci.yml for the reason why we disable NuGet audit warnings.
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
node-version: "15"
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Build
# We disable NuGet audit warnings, see https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1901-nu1904.
# Security issues being discovered in NuGet packages we use can happen at any time, and thus all our CI builds that
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/preview_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: actions/setup-dotnet@v4
if: steps.check-publish.outputs.should-publish == 'true'
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Set build number
if: steps.check-publish.outputs.should-publish == 'true'
run: echo "BuildNumber=$(( $GITHUB_RUN_NUMBER + 16368 ))" >> $GITHUB_ENV
Expand Down Expand Up @@ -76,6 +76,6 @@ jobs:
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data -Recurse | Remove-Item -Recurse -Confirm:$false
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data_Tests -Recurse | Remove-Item -Recurse -Confirm:$false
$output = [System.IO.Path]::GetFullPath("./.build/release")
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net9.0
docker buildx build -f Dockerfile-CI --platform=linux/amd64 -t orchardproject/orchardcore-cms-linux:dev --push .
docker buildx build -f Dockerfile-CI --platform=windows/amd64 -t orchardproject/orchardcore-cms-windows:dev --push .
4 changes: 2 additions & 2 deletions .github/workflows/release_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
node-version: "15"
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Set build number
if: matrix.os == 'ubuntu-latest'
run: echo "BuildNumber=$(( $GITHUB_RUN_NUMBER + 15471 ))" >> $GITHUB_ENV
Expand Down Expand Up @@ -82,6 +82,6 @@ jobs:
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data -Recurse | Remove-Item -Recurse -Confirm:$false
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data_Tests -Recurse | Remove-Item -Recurse -Confirm:$false
$output = [System.IO.Path]::GetFullPath("./.build/release")
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net9.0
docker buildx build -f Dockerfile-CI --platform=linux/amd64 -t orchardproject/orchardcore-cms-linux:latest -t orchardproject/orchardcore-cms-linux:${{ steps.get_version.outputs.VERSION }} --push .
docker buildx build -f Dockerfile-CI --platform=windows/amd64 -t orchardproject/orchardcore-cms-windows:latest -t orchardproject/orchardcore-cms-windows:${{ steps.get_version.outputs.VERSION }} --push .
22 changes: 11 additions & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console debug) - net8.0",
"name": ".NET Core Launch (console debug) - net9.0",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "dotnet build (debug) - net8.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net8.0/OrchardCore.Cms.Web.dll",
"preLaunchTask": "dotnet build (debug) - net9.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net9.0/OrchardCore.Cms.Web.dll",
"args": [],
"cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web",
"env": {
Expand All @@ -15,12 +15,12 @@
"stopAtEntry": false
},
{
"name": ".NET Core Launch (web debug) - net8.0",
"name": ".NET Core Launch (web debug) - net9.0",
"type": "coreclr",
"request": "launch",
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "dotnet build (debug) - net8.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net8.0/OrchardCore.Cms.Web.dll",
"preLaunchTask": "dotnet build (debug) - net9.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net9.0/OrchardCore.Cms.Web.dll",
"args": [],
"cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web",
"env": {
Expand All @@ -33,11 +33,11 @@
}
},
{
"name": ".NET Core Launch (web release) - net8.0",
"name": ".NET Core Launch (web release) - net9.0",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "dotnet build (release) - net8.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Release/net8.0/OrchardCore.Cms.Web.dll",
"preLaunchTask": "dotnet build (release) - net9.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Release/net9.0/OrchardCore.Cms.Web.dll",
"args": [],
"cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web",
"env": {
Expand All @@ -50,10 +50,10 @@
}
},
{
"name": ".NET Core Launch (web debug) - dotnet watch - net8.0",
"name": ".NET Core Launch (web debug) - dotnet watch - net9.0",
"type": "dotnetwatchattach",
"request": "launch",
"task": "dotnet watch - net8.0",
"task": "dotnet watch - net9.0",
"program": "OrchardCore.Cms.Web.exe",
"args": {
"env": {
Expand Down
42 changes: 21 additions & 21 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
},
"tasks": [
{
"label": "dotnet watch - net8.0",
"label": "dotnet watch - net9.0",
"type": "process",
"command": "dotnet",
"args": [
"watch",
"run",
"${workspaceRoot}/src/OrchardCore.Cms.Web",
"-f",
"net8.0"
"net9.0"
],
"options": {
"cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web"
Expand All @@ -48,7 +48,7 @@
"--project",
"${workspaceRoot}\\src\\OrchardCore.Cms.Web\\OrchardCore.Cms.Web.csproj",
"-f",
"net8.0"
"net9.0"
]
},
{
Expand Down Expand Up @@ -89,7 +89,7 @@
]
},
{
"label": "dotnet build (debug) - net8.0",
"label": "dotnet build (debug) - net9.0",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -98,12 +98,12 @@
"-c",
"Debug",
"-f",
"net8.0"
"net9.0"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet build (release) - net8.0",
"label": "dotnet build (release) - net9.0",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -112,12 +112,12 @@
"-c",
"Release",
"-f",
"net8.0"
"net9.0"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet rebuild (debug) - net8.0",
"label": "dotnet rebuild (debug) - net9.0",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -127,12 +127,12 @@
"-c",
"Debug",
"-f",
"net8.0"
"net9.0"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet rebuild (release) - net8.0",
"label": "dotnet rebuild (release) - net9.0",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -142,7 +142,7 @@
"-c",
"Release",
"-f",
"net8.0"
"net9.0"
],
"problemMatcher": "$msCompile"
},
Expand All @@ -163,7 +163,7 @@
]
},
{
"label": "dotnet publish (self-contained) - release - net8.0",
"label": "dotnet publish (self-contained) - release - net9.0",
"type": "shell",
"command": "dotnet",
"windows": {
Expand All @@ -177,7 +177,7 @@
"win-x64",
"--self-contained",
"--framework",
"net8.0",
"net9.0",
"--output",
".\\.build\\release"
]
Expand All @@ -191,14 +191,14 @@
"linux-x64",
"--self-contained",
"--framework",
"net8.0",
"net9.0",
"--output",
"./.build/release"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet publish (framework dependent) - release - net8.0",
"label": "dotnet publish (framework dependent) - release - net9.0",
"type": "shell",
"command": "dotnet",
"windows": {
Expand All @@ -213,7 +213,7 @@
"--self-contained",
"false",
"--framework",
"net8.0",
"net9.0",
"--output",
".\\.build\\release"
]
Expand All @@ -228,24 +228,24 @@
"--self-contained",
"false",
"--framework",
"net8.0",
"net9.0",
"--output",
"./.build/release"
],
"problemMatcher": "$msCompile"
},
{
"label": "tasks: dotnet publish release (self-contained) - net8.0",
"label": "tasks: dotnet publish release (self-contained) - net9.0",
"dependsOn": [
"cleanup publish folder",
"dotnet publish (self-contained) - net8.0"
"dotnet publish (self-contained) - net9.0"
]
},
{
"label": "tasks: dotnet publish release (framework dependent) - net8.0",
"label": "tasks: dotnet publish release (framework dependent) - net9.0",
"dependsOn": [
"cleanup publish folder",
"dotnet publish (framework dependent) - net8.0"
"dotnet publish (framework dependent) - net9.0"
]
},
{
Expand Down
18 changes: 10 additions & 8 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@
└─ System.Drawing.Common (v4.7.0)
-->
<PackageVersion Include="System.Drawing.Common" Version="4.7.2" />

</ItemGroup>

<ItemGroup Condition="$(TargetFramework) == 'net8.0'" >
<!--
Microsoft.AspNetCore.DataProtection.StackExchangeRedis (v8.0.8)
└─ Microsoft.AspNetCore.DataProtection (v8.0.8)
Expand All @@ -131,17 +133,17 @@
<!-- These versions are used for the NuGet packages that are dependent on the current TFM -->
<!-- Versions are preset for the default TFM (there may be no TFM in an evaluation phase) -->
<PropertyGroup>
<AspNetCorePackagesVersion>9.0.0-preview.7.24406.2</AspNetCorePackagesVersion>
<MicrosoftExtensionsPackagesVersion>9.0.0-preview.7.24406.2</MicrosoftExtensionsPackagesVersion>
</PropertyGroup>

<!-- When dual-targeting frameworks, add both of them to CommonTargetFrameworks in /src/OrchardCore.Build/TargetFrameworks.props
and add PropertyGroups like below. -->
<PropertyGroup Condition="$(TargetFramework) == 'net8.0'">
<AspNetCorePackagesVersion>8.0.8</AspNetCorePackagesVersion>
<MicrosoftExtensionsPackagesVersion>8.0.8</MicrosoftExtensionsPackagesVersion>
</PropertyGroup>

<!-- When dual-targeting frameworks, add both of them to CommonTargetFrameworks above, when add PropertyGroups like
below. -->
<!--<PropertyGroup Condition="$(TargetFramework) == 'net7.0'">
<AspNetCorePackagesVersion>7.0.14</AspNetCorePackagesVersion>
<MicrosoftExtensionsPackagesVersion>7.0.14</MicrosoftExtensionsPackagesVersion>
</PropertyGroup>-->

<!-- 'Microsoft.AspNetCore' packages that are not included in the ASP.NET Core shared framework -->
<ItemGroup>
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Facebook" Version="$(AspNetCorePackagesVersion)" />
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
FROM --platform=$BUILDPLATFORM golang:alpine AS build
ARG TARGETOS

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:9.0-preview AS build-env
LABEL stage=build-env
WORKDIR /app

# Copy and build
COPY ./src /app
COPY Directory.Build.props /

RUN dotnet publish /app/OrchardCore.Cms.Web -c Release -o ./build/release --framework net8.0 /p:RunAnalyzers=false
RUN dotnet publish /app/OrchardCore.Cms.Web -c Release -o ./build/release --framework net9.0 /p:RunAnalyzers=false

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0-nanoserver-1809 AS build_windows
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS build_linux
FROM mcr.microsoft.com/dotnet/aspnet:9.0-preview-nanoserver-1809 AS build_windows
FROM mcr.microsoft.com/dotnet/aspnet:9.0-preview AS build_linux
FROM build_${TARGETOS} AS aspnet

EXPOSE 80
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.101",
"version": "9.0.100-preview",
"rollForward": "latestFeature"
}
}
Loading

0 comments on commit fe5a020

Please sign in to comment.