Skip to content

Commit

Permalink
Dotnet 8.0 (#14058)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtkech authored Oct 23, 2023
1 parent e9978a4 commit 39e2430
Show file tree
Hide file tree
Showing 21 changed files with 151 additions and 58 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 @@ -17,7 +17,7 @@ jobs:
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.100-rc.2.23502.2'
- uses: actions/setup-node@v3
with:
node-version: "15"
Expand All @@ -43,7 +43,7 @@ jobs:
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.100-rc.2.23502.2'
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.100-rc.2.23502.2'
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.100-rc.2.23502.2'
- 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@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.100-rc.2.23502.2'
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mac_unit_test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- uses: actions/checkout@v3
- name: Build and test
run: |
dotnet build -c Release -f net8.0
dotnet build -c Release -f net7.0
dotnet build -c Release -f net6.0
dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
4 changes: 4 additions & 0 deletions .github/workflows/pr_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: "15"
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.100-rc.2.23502.2'
- name: Build
run: |
dotnet build -c Release -f net8.0
dotnet build -c Release -f net7.0
dotnet build -c Release -f net6.0
- name: Unit Tests
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/preview_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
run: echo "BuildNumber=$(( $GITHUB_RUN_NUMBER + 16368 ))" >> $GITHUB_ENV
- name: Build
run: |
dotnet build -c Release -f net8.0
dotnet build -c Release -f net7.0
dotnet build -c Release -f net6.0
- name: Unit Tests
Expand Down Expand Up @@ -64,7 +65,7 @@ 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 net7.0
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0
docker build -f Dockerfile-CI -t orchardproject/orchardcore-cms-linux:dev .
docker push orchardproject/orchardcore-cms-linux:dev
- name: Deploy preview docker image for windows
Expand All @@ -73,7 +74,7 @@ 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 net7.0
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0
docker build -f Dockerfile-CI -t orchardproject/orchardcore-cms-windows:dev .
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u="${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
docker push orchardproject/orchardcore-cms-windows:dev
5 changes: 3 additions & 2 deletions .github/workflows/release_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
run: echo "BuildNumber=$(( $GITHUB_RUN_NUMBER + 15471 ))" >> $GITHUB_ENV
- name: Build
run: |
dotnet build -c Release -f net8.0 -p:Version=${{ steps.get_version.outputs.VERSION }}
dotnet build -c Release -f net7.0 -p:Version=${{ steps.get_version.outputs.VERSION }}
dotnet build -c Release -f net6.0 -p:Version=${{ steps.get_version.outputs.VERSION }}
- name: Unit Tests
Expand Down Expand Up @@ -75,7 +76,7 @@ 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 net7.0
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0
docker build -f Dockerfile-CI -t orchardproject/orchardcore-cms-linux:latest -t orchardproject/orchardcore-cms-linux:${{ steps.get_version.outputs.VERSION }} .
docker push orchardproject/orchardcore-cms-linux:latest
docker push "orchardproject/orchardcore-cms-linux:${{ steps.get_version.outputs.VERSION }}"
Expand All @@ -85,7 +86,7 @@ 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 net7.0
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0
docker build -f Dockerfile-CI -t orchardproject/orchardcore-cms-windows:latest -t orchardproject/orchardcore-cms-windows:${{ steps.get_version.outputs.VERSION }} .
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u="${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
docker push orchardproject/orchardcore-cms-windows:latest
Expand Down
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) - net7.0",
"name": ".NET Core Launch (console debug) - net8.0",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "dotnet build (debug) - net7.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net7.0/OrchardCore.Cms.Web.dll",
"preLaunchTask": "dotnet build (debug) - net8.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net8.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) - net7.0",
"name": ".NET Core Launch (web debug) - net8.0",
"type": "coreclr",
"request": "launch",
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "dotnet build (debug) - net7.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net7.0/OrchardCore.Cms.Web.dll",
"preLaunchTask": "dotnet build (debug) - net8.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net8.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) - net7.0",
"name": ".NET Core Launch (web release) - net8.0",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "dotnet build (release) - net7.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Release/net7.0/OrchardCore.Cms.Web.dll",
"preLaunchTask": "dotnet build (release) - net8.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Release/net8.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 - net7.0",
"name": ".NET Core Launch (web debug) - dotnet watch - net8.0",
"type": "dotnetwatchattach",
"request": "launch",
"task": "dotnet watch - net7.0",
"task": "dotnet watch - net8.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 - net7.0",
"label": "dotnet watch - net8.0",
"type": "process",
"command": "dotnet",
"args": [
"watch",
"run",
"${workspaceRoot}/src/OrchardCore.Cms.Web",
"-f",
"net7.0"
"net8.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",
"net7.0"
"net8.0"
]
},
{
Expand Down Expand Up @@ -89,7 +89,7 @@
]
},
{
"label": "dotnet build (debug) - net7.0",
"label": "dotnet build (debug) - net8.0",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -98,12 +98,12 @@
"-c",
"Debug",
"-f",
"net7.0"
"net8.0"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet build (release) - net7.0",
"label": "dotnet build (release) - net8.0",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -112,12 +112,12 @@
"-c",
"Release",
"-f",
"net7.0"
"net8.0"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet rebuild (debug) - net7.0",
"label": "dotnet rebuild (debug) - net8.0",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -127,12 +127,12 @@
"-c",
"Debug",
"-f",
"net7.0"
"net8.0"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet rebuild (release) - net7.0",
"label": "dotnet rebuild (release) - net8.0",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -142,7 +142,7 @@
"-c",
"Release",
"-f",
"net7.0"
"net8.0"
],
"problemMatcher": "$msCompile"
},
Expand All @@ -163,7 +163,7 @@
]
},
{
"label": "dotnet publish (self-contained) - release - net7.0",
"label": "dotnet publish (self-contained) - release - net8.0",
"type": "shell",
"command": "dotnet",
"windows": {
Expand All @@ -177,7 +177,7 @@
"win-x64",
"--self-contained",
"--framework",
"net7.0",
"net8.0",
"--output",
".\\.build\\release"
]
Expand All @@ -191,14 +191,14 @@
"linux-x64",
"--self-contained",
"--framework",
"net7.0",
"net8.0",
"--output",
"./.build/release"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet publish (framework dependent) - release - net7.0",
"label": "dotnet publish (framework dependent) - release - net8.0",
"type": "shell",
"command": "dotnet",
"windows": {
Expand All @@ -213,7 +213,7 @@
"--self-contained",
"false",
"--framework",
"net7.0",
"net8.0",
"--output",
".\\.build\\release"
]
Expand All @@ -228,24 +228,24 @@
"--self-contained",
"false",
"--framework",
"net7.0",
"net8.0",
"--output",
"./.build/release"
],
"problemMatcher": "$msCompile"
},
{
"label": "tasks: dotnet publish release (self-contained) - net7.0",
"label": "tasks: dotnet publish release (self-contained) - net8.0",
"dependsOn": [
"cleanup publish folder",
"dotnet publish (self-contained) - net7.0"
"dotnet publish (self-contained) - net8.0"
]
},
{
"label": "tasks: dotnet publish release (framework dependent) - net7.0",
"label": "tasks: dotnet publish release (framework dependent) - net8.0",
"dependsOn": [
"cleanup publish folder",
"dotnet publish (framework dependent) - net7.0"
"dotnet publish (framework dependent) - net8.0"
]
},
{
Expand Down
9 changes: 7 additions & 2 deletions src/OrchardCore.Build/Dependencies.AspNetCore.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

<!-- TFM used when coding in Visual Studio and when creating templates -->
<!-- All 'template.json' should provide a 'choice' for the default TFM -->
<DefaultTargetFramework>net7.0</DefaultTargetFramework>
<DefaultTargetFramework>net8.0</DefaultTargetFramework>

<!-- TFMs used to build the abstractions and modules, by convention the default TFM is at the first position -->
<!-- In a cross-targeting build, some assets are only copied on the first TFM, by convention the default TFM -->
<CommonTargetFrameworks Condition="'$(CommonTargetFrameworks)' == ''">net7.0;net6.0</CommonTargetFrameworks>
<CommonTargetFrameworks Condition="'$(CommonTargetFrameworks)' == ''">net8.0;net7.0;net6.0</CommonTargetFrameworks>
</PropertyGroup>

<!-- Detect if the solution is opened in VS to limit the TFMs that are analyzed by Roslyn for performance reasons -->
Expand All @@ -20,6 +20,11 @@
<!-- 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>8.0.0-rc.2.23480.2</AspNetCorePackagesVersion>
<MicrosoftExtensionsPackagesVersion>8.0.0-rc.2.23480.2</MicrosoftExtensionsPackagesVersion>
</PropertyGroup>

<PropertyGroup Condition="$(TargetFramework) == 'net7.0'">
<AspNetCorePackagesVersion>7.0.12</AspNetCorePackagesVersion>
<MicrosoftExtensionsPackagesVersion>7.0.12</MicrosoftExtensionsPackagesVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@ namespace OrchardCore.GitHub.Configuration
{
public class GitHubHandler : OAuthHandler<GitHubOptions>
{

#if !NET8_0_OR_GREATER
public GitHubHandler(IOptionsMonitor<GitHubOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock)
: base(options, logger, encoder, clock)
{ }
#else
public GitHubHandler(IOptionsMonitor<GitHubOptions> options, ILoggerFactory logger, UrlEncoder encoder)
: base(options, logger, encoder)
{ }
#endif

protected override async Task<AuthenticationTicket> CreateTicketAsync(ClaimsIdentity identity, AuthenticationProperties properties, OAuthTokenResponse tokens)
{
Expand Down
Loading

0 comments on commit 39e2430

Please sign in to comment.