From 8988da93dd73e508e0fa834a70504a19d93b540e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Poul=20Kjeldager=20S=C3=B8rensen?= Date: Wed, 13 Nov 2024 00:38:59 +0100 Subject: [PATCH] feat!: updated for .net 9 --- .github/workflows/build.yml | 16 ++++++++-------- .github/workflows/prerelease.yml | 4 ++-- .github/workflows/release.yml | 12 ++++++------ .github/workflows/todo.yml | 8 +++++--- WorkflowEngine.sln | 17 ++++++++++------- .../WorkflowEngine.DemoApp.csproj | 4 ++-- .../WorkflowEngine.Core.csproj | 8 ++++---- .../HangfireWorkflowExecutor.cs | 3 ++- .../WorkflowEngine.Hangfire.csproj | 16 +++++----------- .../WorkflowStarterBackgroundJob.cs | 3 ++- 10 files changed, 46 insertions(+), 45 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 461dd84..f6d6099 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,10 +14,10 @@ jobs: strategy: matrix: include: - - framework: "net6.0" - version: 6.0.x - - framework: net8.0 + - framework: "net8.0" version: 8.0.x + - framework: net9.0 + version: 9.0.x steps: - name: Checkout code base @@ -25,7 +25,7 @@ jobs: - uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Run tests run: dotnet test --verbosity normal -f ${{ matrix.framework }} @@ -36,17 +36,17 @@ jobs: strategy: matrix: include: - - framework: "net6.0" - version: 6.0.x - - framework: net8.0 + - framework: "net8.0" version: 8.0.x + - framework: net9.0 + version: 9.0.x steps: - name: Checkout code base uses: actions/checkout@v4 - uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Cleaning run: dotnet clean diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 9780c03..5c7d168 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -15,12 +15,12 @@ jobs: - uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.x' + dotnet-version: '9.0.x' - name: Setup Node.js uses: actions/setup-node@v1 with: - node-version: 16 + node-version: 22 - name: Add plugin for conventional commits run: npm install conventional-changelog-conventionalcommits diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cbc4188..bc9cea5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,17 +13,17 @@ jobs: strategy: matrix: include: - - framework: "net6.0" - version: 6.0.x - - framework: net8.0 + - framework: "net8.0" version: 8.0.x + - framework: net9.0 + version: 9.0.x steps: - name: Checkout code base uses: actions/checkout@v4 - uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Run tests run: dotnet test --verbosity normal -f ${{ matrix.framework }} @@ -46,12 +46,12 @@ jobs: - uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + dotnet-version: '9.0.x' - name: Setup Node.js uses: actions/setup-node@v1 with: - node-version: 20 + node-version: 22 - name: Add plugin for conventional commits run: npm install conventional-changelog-conventionalcommits diff --git a/.github/workflows/todo.yml b/.github/workflows/todo.yml index 2ade5ec..968e87a 100644 --- a/.github/workflows/todo.yml +++ b/.github/workflows/todo.yml @@ -1,18 +1,20 @@ -name: "Create issues from todo" +name: "Create issues from todo" on: push: branches: - 'dev' + - 'master' - 'feature/**' jobs: build: runs-on: "ubuntu-latest" steps: - - uses: "actions/checkout@master" + - name: Checkout repo + uses: actions/checkout@v2 - name: "TODO to Issue" - uses: "alstr/todo-to-issue-action@v2.4" + uses: "alstr/todo-to-issue-action@v5" id: "todo" with: TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/WorkflowEngine.sln b/WorkflowEngine.sln index 2a56325..d99d7fc 100644 --- a/WorkflowEngine.sln +++ b/WorkflowEngine.sln @@ -11,22 +11,25 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject .gitignore = .gitignore .github\workflows\.releaserc = .github\workflows\.releaserc - .github\workflows\build.yml = .github\workflows\build.yml - .github\workflows\prerelease.yml = .github\workflows\prerelease.yml README.md = README.md - .github\workflows\release.yml = .github\workflows\release.yml - .github\workflows\todo.yml = .github\workflows\todo.yml EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowEngine.Hangfire", "src\WorkflowEngine.Hangfire\WorkflowEngine.Hangfire.csproj", "{7A50D90B-98AE-4B7F-9B39-8828D9ACED5B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NewFolder1", "NewFolder1", "{144FC2ED-C165-401D-BDD8-9431B447C96C}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{76AE8C20-E425-4B07-BFAA-536CCF9ED4EB}" ProjectSection(SolutionItems) = preProject .github\dependabot.yml = .github\dependabot.yml EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{93A05ACF-3938-4543-9DA0-CE5D8F389790}" + ProjectSection(SolutionItems) = preProject + .github\workflows\.releaserc = .github\workflows\.releaserc + .github\workflows\build.yml = .github\workflows\build.yml + .github\workflows\prerelease.yml = .github\workflows\prerelease.yml + .github\workflows\release.yml = .github\workflows\release.yml + .github\workflows\todo.yml = .github\workflows\todo.yml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -50,7 +53,7 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {144FC2ED-C165-401D-BDD8-9431B447C96C} = {0749C5E8-52D4-4B3A-89EA-891DD156A056} + {93A05ACF-3938-4543-9DA0-CE5D8F389790} = {76AE8C20-E425-4B07-BFAA-536CCF9ED4EB} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {56ADE641-E5CE-4AED-AB11-4D507F8C0816} diff --git a/apps/WorkflowEngine.DemoApp/WorkflowEngine.DemoApp.csproj b/apps/WorkflowEngine.DemoApp/WorkflowEngine.DemoApp.csproj index 386eb64..e94dc55 100644 --- a/apps/WorkflowEngine.DemoApp/WorkflowEngine.DemoApp.csproj +++ b/apps/WorkflowEngine.DemoApp/WorkflowEngine.DemoApp.csproj @@ -1,13 +1,13 @@ - net6.0 + net8.0 false - + diff --git a/src/WorkflowEngine.Core/WorkflowEngine.Core.csproj b/src/WorkflowEngine.Core/WorkflowEngine.Core.csproj index 3db0eec..0962a56 100644 --- a/src/WorkflowEngine.Core/WorkflowEngine.Core.csproj +++ b/src/WorkflowEngine.Core/WorkflowEngine.Core.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0 + net8.0;net9.0 Delegate.WorkflowEngine.Core Delegate A/S @@ -13,12 +13,12 @@ - + - - + + diff --git a/src/WorkflowEngine.Hangfire/HangfireWorkflowExecutor.cs b/src/WorkflowEngine.Hangfire/HangfireWorkflowExecutor.cs index 66de50b..ee15d90 100644 --- a/src/WorkflowEngine.Hangfire/HangfireWorkflowExecutor.cs +++ b/src/WorkflowEngine.Hangfire/HangfireWorkflowExecutor.cs @@ -192,7 +192,8 @@ public async ValueTask TriggerAsync(ITriggerContext triggerContext, Perf var action = await executor.Trigger(triggerContext); if (action != null) - { + { + var a = backgroundJobClient.Enqueue(queue, (executor) => executor.ExecuteAsync(triggerContext, triggerContext.Workflow, action, null)); } diff --git a/src/WorkflowEngine.Hangfire/WorkflowEngine.Hangfire.csproj b/src/WorkflowEngine.Hangfire/WorkflowEngine.Hangfire.csproj index 9f3cfe6..c2a91c0 100644 --- a/src/WorkflowEngine.Hangfire/WorkflowEngine.Hangfire.csproj +++ b/src/WorkflowEngine.Hangfire/WorkflowEngine.Hangfire.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0 + net8.0;net9.0 Delegate.WorkflowEngine.Hangfire Delegate A/S @@ -11,18 +11,12 @@ - + - - - - - - - - - + + + diff --git a/src/WorkflowEngine.Hangfire/WorkflowStarterBackgroundJob.cs b/src/WorkflowEngine.Hangfire/WorkflowStarterBackgroundJob.cs index dfad4c6..f40cd74 100644 --- a/src/WorkflowEngine.Hangfire/WorkflowStarterBackgroundJob.cs +++ b/src/WorkflowEngine.Hangfire/WorkflowStarterBackgroundJob.cs @@ -58,6 +58,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) } workflow.Manifest = null; + jobs.AddOrUpdate(workflow.Id.ToString() + trigger.Key, options.Value.QueueName, (System.Linq.Expressions.Expression>) ((executor) => executor.TriggerAsync(new TriggerContext @@ -75,7 +76,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) }, }, null)), trigger.Value.Inputs["cronExpression"] as string,new RecurringJobOptions { - TimeZone = GetTimeZone(trigger), + TimeZone = GetTimeZone(trigger), });