From 1a5ad320ff08ccd6cf899ddcc040c7ddf65736c7 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Wed, 6 Nov 2024 14:27:00 -0600 Subject: [PATCH] Remove NUKE and move to basic `dotnet` CLI-based build system (#514) * deleted all NUKE code from `.sln` * moved to basic CLI build system * fix the name of our project * simplify * remove multi-line build * exclude TestKit as test project * fixed dotnet pack --- .github/dependabot.yaml | 14 + .github/dependabot.yml | 15 - .github/workflows/Windows_release.yml | 51 --- .github/workflows/pr_validation.yml | 102 ++--- .github/workflows/publish_nuget.yml | 52 +++ Akka.Hosting.sln | 10 +- Directory.Build.props | 45 ++ RELEASE_NOTES.md | 239 +--------- build.cmd | 7 - build.ps1 | 244 +--------- build.sh | 62 --- build/.editorconfig | 11 - build/Build.CI.GitHubActions.cs | 96 ---- build/Build.cs | 431 ------------------ build/Configuration.cs | 16 - build/Directory.Build.props | 8 - build/Directory.Build.targets | 8 - build/MdHelper.cs | 175 ------- build/XmlHelper.cs | 73 --- build/_build.csproj | 18 - build/_build.csproj.DotSettings | 30 -- global.json | 6 + scripts/bumpVersion.ps1 | 28 ++ scripts/getReleaseNotes.ps1 | 44 ++ .../Akka.Hosting.TestKit.csproj | 1 + src/Directory.Build.props | 50 -- 26 files changed, 240 insertions(+), 1596 deletions(-) create mode 100644 .github/dependabot.yaml delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/Windows_release.yml create mode 100644 .github/workflows/publish_nuget.yml create mode 100644 Directory.Build.props delete mode 100755 build.cmd delete mode 100755 build.sh delete mode 100644 build/.editorconfig delete mode 100644 build/Build.CI.GitHubActions.cs delete mode 100644 build/Build.cs delete mode 100644 build/Configuration.cs delete mode 100644 build/Directory.Build.props delete mode 100644 build/Directory.Build.targets delete mode 100644 build/MdHelper.cs delete mode 100644 build/XmlHelper.cs delete mode 100644 build/_build.csproj delete mode 100644 build/_build.csproj.DotSettings create mode 100644 global.json create mode 100644 scripts/bumpVersion.ps1 create mode 100644 scripts/getReleaseNotes.ps1 delete mode 100644 src/Directory.Build.props diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 00000000..fa70a0f9 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,14 @@ +version: 2 + +updates: +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + time: "11:00" + +- package-ecosystem: nuget + directory: "/" + schedule: + interval: daily + time: "11:00" diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ab7081cc..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,15 +0,0 @@ -version: 2 -updates: -- package-ecosystem: nuget - target-branch: "dev" - directory: "/" - schedule: - interval: daily - time: "11:00" - open-pull-requests-limit: 10 - labels: - - "dependencies" - ignore: - - dependency-name: Microsoft.NET.Test.Sdk - versions: - - 16.8.3 diff --git a/.github/workflows/Windows_release.yml b/.github/workflows/Windows_release.yml deleted file mode 100644 index 4124954d..00000000 --- a/.github/workflows/Windows_release.yml +++ /dev/null @@ -1,51 +0,0 @@ -# ------------------------------------------------------------------------------ -# -# -# This code was generated. -# -# - To turn off auto-generation set: -# -# [CustomGitHubActions (AutoGenerate = false)] -# -# - To trigger manual generation invoke: -# -# nuke --generate-configuration GitHubActions_Windows_release --host GitHubActions -# -# -# ------------------------------------------------------------------------------ - -name: Windows_release - -on: - push: - tags: - - '*' - -jobs: - windows-latest: - name: windows-latest - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - name: Make build.sh executable - run: chmod +x ./build.sh - - name: Make build.cmd executable - run: chmod +x ./build.cmd - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 5.0.* - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.* - - name: Cache .nuke/temp, ~/.nuget/packages - uses: actions/cache@v3 - with: - path: | - .nuke/temp - ~/.nuget/packages - key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - - name: Run './build.cmd NuGet' - run: ./build.cmd NuGet - env: - Nuget_Key: ${{ secrets.NUGET_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr_validation.yml b/.github/workflows/pr_validation.yml index d870b26f..3e0b0b9c 100644 --- a/.github/workflows/pr_validation.yml +++ b/.github/workflows/pr_validation.yml @@ -1,19 +1,3 @@ -# ------------------------------------------------------------------------------ -# -# -# This code was generated. -# -# - To turn off auto-generation set: -# -# [CustomGitHubActions (AutoGenerate = false)] -# -# - To trigger manual generation invoke: -# -# nuke --generate-configuration GitHubActions_pr_validation --host GitHubActions -# -# -# ------------------------------------------------------------------------------ - name: pr_validation on: @@ -21,63 +5,47 @@ on: branches: - master - dev - - 'v1.*' + - main pull_request: branches: - master - dev - - 'v1.*' + - main jobs: - windows-latest: - name: windows-latest - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - name: Make build.sh executable - run: chmod +x ./build.sh - - name: Make build.cmd executable - run: chmod +x ./build.cmd - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 5.0.* - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.* - - name: Cache .nuke/temp, ~/.nuget/packages - uses: actions/cache@v3 - with: - path: | - .nuke/temp - ~/.nuget/packages - key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - - name: Run './build.cmd All' - run: ./build.cmd All - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ubuntu-latest: - name: ubuntu-latest - runs-on: ubuntu-latest + test: + name: Test-${{matrix.os}} + runs-on: ${{matrix.os}} + + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + steps: - - uses: actions/checkout@v3 - - name: Make build.sh executable - run: chmod +x ./build.sh - - name: Make build.cmd executable - run: chmod +x ./build.cmd - - uses: actions/setup-dotnet@v1 + - name: "Checkout" + uses: actions/checkout@v4.1.1 with: - dotnet-version: 5.0.* - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.* - - name: Cache .nuke/temp, ~/.nuget/packages - uses: actions/cache@v3 + lfs: true + fetch-depth: 0 + + - name: "Install .NET SDK" + uses: actions/setup-dotnet@v4.0.0 with: - path: | - .nuke/temp - ~/.nuget/packages - key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - - name: Run './build.cmd All' - run: ./build.cmd All - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + global-json-file: "./global.json" + + - name: "Update release notes" + shell: pwsh + run: | + ./build.ps1 + + - name: "dotnet build" + run: dotnet build -c Release + + # .NET Framework tests can't run reliably on Linux, so we only do .NET 8 + + - name: "dotnet test" + shell: bash + run: dotnet test -c Release + + - name: "dotnet pack" + run: dotnet pack -c Release -o ./bin/nuget \ No newline at end of file diff --git a/.github/workflows/publish_nuget.yml b/.github/workflows/publish_nuget.yml new file mode 100644 index 00000000..ae1bb7a4 --- /dev/null +++ b/.github/workflows/publish_nuget.yml @@ -0,0 +1,52 @@ +name: Publish NuGet + +on: + push: + tags: + - '*' + +jobs: + publish-nuget: + + name: publish-nuget + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: "Update release notes" + shell: pwsh + run: | + ./build.ps1 + + - name: Create Packages + run: dotnet pack /p:PackageVersion=${{ github.ref_name }} -c Release -o ./output + + - name: Push Packages + run: dotnet nuget push "output/*.nupkg" -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json + + - name: release + uses: actions/create-release@v1 + id: create_release + with: + draft: false + prerelease: false + release_name: 'Akka.Hosting ${{ github.ref_name }}' + tag_name: ${{ github.ref }} + body_path: RELEASE_NOTES.md + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Upload Release Asset + uses: AButler/upload-release-assets@v3.0 + with: + repo-token: ${{ github.token }} + release-tag: ${{ github.ref_name }} + files: 'output/*.nupkg' \ No newline at end of file diff --git a/Akka.Hosting.sln b/Akka.Hosting.sln index 7b1875c8..4d45a93c 100644 --- a/Akka.Hosting.sln +++ b/Akka.Hosting.sln @@ -9,13 +9,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.Hosting.Tests", "src\A EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.Hosting.Tests.Performance", "src\Akka.Hosting.Tests.Performance\Akka.Hosting.Tests.Performance.csproj", "{F7035FC5-8658-42AC-9317-749CC089C262}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{AD88EB36-E919-4948-855E-2223B5826AA7}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2B9D74C1-4148-46EF-B3FE-7357839FAF40}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{2B9D74C1-4148-46EF-B3FE-7357839FAF40}" ProjectSection(SolutionItems) = preProject - src\Directory.Build.props = src\Directory.Build.props README.md = README.md RELEASE_NOTES.md = RELEASE_NOTES.md + global.json = global.json + nuget.config = nuget.config + Directory.Build.props = Directory.Build.props EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.Hosting.SimpleDemo", "src\Examples\Akka.Hosting.SimpleDemo\Akka.Hosting.SimpleDemo.csproj", "{5F6A7BE8-6906-46CE-BA1C-72EA11EFA33B}" @@ -60,8 +60,6 @@ Global {F7035FC5-8658-42AC-9317-749CC089C262}.Debug|Any CPU.Build.0 = Debug|Any CPU {F7035FC5-8658-42AC-9317-749CC089C262}.Release|Any CPU.ActiveCfg = Release|Any CPU {F7035FC5-8658-42AC-9317-749CC089C262}.Release|Any CPU.Build.0 = Release|Any CPU - {AD88EB36-E919-4948-855E-2223B5826AA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AD88EB36-E919-4948-855E-2223B5826AA7}.Release|Any CPU.ActiveCfg = Release|Any CPU {5F6A7BE8-6906-46CE-BA1C-72EA11EFA33B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5F6A7BE8-6906-46CE-BA1C-72EA11EFA33B}.Debug|Any CPU.Build.0 = Debug|Any CPU {5F6A7BE8-6906-46CE-BA1C-72EA11EFA33B}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..6e4402fc --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,45 @@ + + + Copyright © 2013-2024 Akka.NET Team + Akka.NET Team + 1.5.30.1 + * [Fix ActorRegistry.GetAsync() returning Nobody](https://github.com/akkadotnet/Akka.Hosting/pull/501) + akkalogo.png + + https://github.com/akkadotnet/Akka.Hosting + + Apache-2.0 + $(NoWarn);CS1591 + README.md + + + 10.0 + enable + + + netstandard2.0 + net8.0 + 2.8.1 + 17.11.1 + 6.0.2 + 2.8.1 + 1.5.30 + [6.0.0,) + + + + + + + + + + + true + + true + + true + snupkg + + \ No newline at end of file diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 5e9b50ca..30fdaebe 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,238 +1,3 @@ -## [1.5.30.1] / October 18th 2024 +#### 1.5.30.1 October 18th 2024 #### -* [Fix ActorRegistry.GetAsync() returning Nobody](https://github.com/akkadotnet/Akka.Hosting/pull/501) - -## [1.5.30] / October 3rd 2024 - -* [Update Akka.NET to 1.5.30](https://github.com/akkadotnet/akka.net/releases/tag/1.5.30) -* [Make sure that any exceptions thrown during start-up are logged and stops the application](https://github.com/akkadotnet/Akka.Hosting/pull/494) - -## [1.5.29] / October 1st 2024 - -> [!NOTE] -> -> **Deprecated** -> -> Deprecated due to Akka.NET 1.5.29 deprecation. Please use 1.5.30 instead. - -* [Update Akka.NET to 1.5.29](https://github.com/akkadotnet/akka.net/releases/tag/1.5.29) -* [Make sure that any exceptions thrown during start-up are logged and stops the application](https://github.com/akkadotnet/Akka.Hosting/pull/494) - -## [1.5.28] / 4 September 2024 - -* [Update Akka.NET to 1.5.28](https://github.com/akkadotnet/akka.net/releases/tag/1.5.29) -* [Include Akka.Streams configuration by default](https://github.com/akkadotnet/Akka.Hosting/pull/489) - -## [1.5.27] / 29 July 2024 - -* [Update Akka.NET to 1.5.27.1](https://github.com/akkadotnet/akka.net/releases/tag/1.5.27.1) -* [Fix only the last ShardOptions were applied](https://github.com/akkadotnet/Akka.Hosting/pull/480) -* [Add ClusterClientDiscovery support](https://github.com/akkadotnet/Akka.Hosting/pull/478) - -> [!Note] -> -> We added support for cluster client initial contact discovery feature in this feature. -> To use this feature, you will need to use Akka.Management v1.5.27 or higher. - -## [1.5.25] / 17 June 2024 - -* [Update Akka.NET to 1.5.25](https://github.com/akkadotnet/akka.net/releases/tag/1.5.25), which resolves a critical bug: [Akka.Logging: v1.5.21 appears to have truncated log source, timestamps, etc from all log messages ](https://github.com/akkadotnet/akka.net/issues/7255) - -## [1.5.24] / 10 June 2024 - -* [Update Akka.NET to 1.5.24](https://github.com/akkadotnet/akka.net/releases/tag/1.5.24) -* [Add ShardedDaemonProcess integration](https://github.com/akkadotnet/Akka.Hosting/pull/463) - -You can now start `ShardedDaemonProcess` host and proxy using Akka.Hosting through 2 new _Akka.Cluster.Hosting_ extension methods - -```csharp -public static AkkaConfigurationBuilder WithShardedDaemonProcess( - this AkkaConfigurationBuilder builder, - string name, - int numberOfInstances, - Func> entityPropsFactory, - ClusterDaemonOptions? options = null) -``` - -```csharp -public static AkkaConfigurationBuilder WithShardedDaemonProcessProxy( - this AkkaConfigurationBuilder builder, - string name, - int numberOfInstances, - string role) -``` - -## [1.5.22] / 4 June 2024 - -* [Update Akka.NET to 1.5.22](https://github.com/akkadotnet/akka.net/releases/tag/1.5.22) -* [Add log filtering extension method](https://github.com/akkadotnet/Akka.Hosting/pull/460) - -**Filtering Logs In Akka.NET** - -In Akka.NET 1.5.21, we introduced [log filtering for log messages based on the LogSource or the content of a log message](https://getakka.net/articles/utilities/logging.html#filtering-log-messages). Depending on your coding style, you can use this feature in Akka.Hosting in several ways. - -1. Using The `LoggerConfigBuilder.WithLogFilter()` method. - - The `LoggerConfigBuilder.WithLogFilter()` method lets you set up the `LogFilterBuilder` - - ```csharp - builder.Services.AddAkka("MyActorSystem", configurationBuilder => - { - configurationBuilder - .ConfigureLoggers(loggerConfigBuilder => - { - loggerConfigBuilder.WithLogFilter(filterBuilder => - { - filterBuilder.ExcludeMessageContaining("Test"); - }); - }); - }); - ``` - -2. Setting the `loggerConfigBuilder.LogFilterBuilder` property directly. - - ```csharp - builder.Services.AddAkka("MyActorSystem", configurationBuilder => - { - configurationBuilder - .ConfigureLoggers(loggerConfigBuilder => - { - loggerConfigBuilder.LogFilterBuilder = new LogFilterBuilder(); - loggerConfigBuilder.LogFilterBuilder.ExcludeMessageContaining("Test"); - }); - }); - ``` - -## [1.5.20] / 30 April 2024 - -* [Update Akka.NET to 1.5.20](https://github.com/akkadotnet/akka.net/releases/tag/1.5.20) -* Added improved APIs for setting default `ILogMessageFormatter`s - the `LoggerConfigBuilder.WithDefaultLogMessageFormatter` method. - -## [1.5.19] / 17 April 2024 - -* [Update Akka.NET to 1.5.19](https://github.com/akkadotnet/akka.net/releases/tag/1.5.19) - -## [1.5.18] / 15 March 2024 - -* [Update Akka.NET to 1.5.18](https://github.com/akkadotnet/akka.net/releases/tag/1.5.18) - -## [1.5.17.1] / 04 March 2024 - -* [Update Akka.NET to 1.5.17.1](https://github.com/akkadotnet/akka.net/releases/tag/1.5.17.1) - -## [1.5.16] / 23 February 2024 - -* [Update Akka.NET to 1.5.16](https://github.com/akkadotnet/akka.net/releases/tag/1.5.16) - -## [1.5.15] / 10 January 2024 - -* [Update Akka.NET to 1.5.15](https://github.com/akkadotnet/akka.net/releases/tag/1.5.15) -* Marked all Akka.Cluster.Hosting methods that accept deprecated sharding delegates as `Obsolete` - -## [1.5.14] / 09 January 2024 - -* [Update Akka.NET to 1.5.14](https://github.com/akkadotnet/akka.net/releases/tag/1.5.14) -* [Akka.Cluster.Hosting: don't use sharding delegates](https://github.com/akkadotnet/Akka.Hosting/pull/424) -* [Akka.Hosting.TestKit: Add method to configure `IHostBuilder`](https://github.com/akkadotnet/Akka.Hosting/pull/423) - -## [1.5.12.1] / 31 August 2023 - -* [Add IConfiguration to HOCON adapter key name normalization toggle flag](https://github.com/akkadotnet/Akka.Hosting/pull/365) -* [Expand Cluster.Hosting and Remote.Hosting options](https://github.com/akkadotnet/Akka.Hosting/pull/366) - -You can now specify whether IConfiguration key strings should be normalized to lower case or not when they are being converted into HOCON keys. You can read the documentation [here](https://github.com/akkadotnet/Akka.Hosting/#special-characters-and-case-sensitivity) - -## [1.5.12] / 3 August 2023 - -* [Update Akka.NET to 1.5.12](https://github.com/akkadotnet/akka.net/releases/tag/1.5.12) -* [TestKit: Fix missing actor context on test start](https://github.com/akkadotnet/Akka.Hosting/pull/346) -* [Remote: Add SSL settings into RemoteOptions](https://github.com/akkadotnet/Akka.Hosting/pull/345) - -## [1.5.8.1] / 12 July 2023 - -* [[Akka.Cluster.Hosting] Fix missing ClusterClient default HOCON configuration](https://github.com/akkadotnet/Akka.Hosting/pull/337) - -## [1.5.8] / 21 June 2023 - -* [Update Akka.NET to 1.5.8](https://github.com/akkadotnet/akka.net/releases/tag/1.5.8) -* [[Akka.Cluster.Hosting] PassivateEntityAfter should not override HOCON settings](https://github.com/akkadotnet/Akka.Hosting/pull/318) -* [[Akka.Hosting] Set application exit code to -1 if CoordinatedShutdown was caused by cluster down or leave](https://github.com/akkadotnet/Akka.Hosting/pull/329) - -## [1.5.7] / 23 May 2023 - -* [Update Akka.NET to 1.5.7](https://github.com/akkadotnet/akka.net/releases/tag/1.5.7) - -## [1.5.6.1] / 17 May 2023 - -* [Akka.Hosting now throws `PlatformNotSupportedException`](https://github.com/akkadotnet/Akka.Hosting/pull/293) when attempting to run on Maui, due to https://github.com/dotnet/maui/issues/2244. Maui support will be added in https://github.com/akkadotnet/Akka.Hosting.Maui -* [make `AkkaHostedService` `public` + `virtual` so it can be extended and customized](https://github.com/akkadotnet/Akka.Hosting/pull/306) - advanced feature. - -## [1.5.6] / 10 May 2023 - -* [Update Akka.NET to 1.5.6](https://github.com/akkadotnet/akka.net/releases/tag/1.5.6) - -## [1.5.5] / 4 May 2023 - -* [Update Akka.NET to 1.5.5](https://github.com/akkadotnet/akka.net/releases/tag/1.5.5) - -## [1.5.4.1] / 1 May 2023 - -* [Add ShardOptions.PassivateIdleEntityAfter option property](https://github.com/akkadotnet/Akka.Hosting/pull/290) - -## [1.5.4] / 24 April 2023 - -* [Update Akka.NET to 1.5.4](https://github.com/akkadotnet/akka.net/releases/tag/1.5.4) -* Update Akka.Persistence.SqlServer to 1.5.4 -* Update Akka.Persistence.PostgreSql to 1.5.4 - -## [1.5.3] / 24 April 2023 - -* [Update Akka.NET to 1.5.3](https://github.com/akkadotnet/akka.net/releases/tag/1.5.3) -* [Add SQL transaction isolation level support](https://github.com/akkadotnet/Akka.Hosting/pull/284) - -**SQL Transaction Isolation Level Setting** - -In 1.5.3, we're introducing fine-grained control over transaction isolation level inside the `Akka.Persistence.Hosting`, `Akka.Persistence.SqlServer.Hosting`, and `Akka.Persistence.PostgreSql.Hosting` plugins. - -you can go to the [official Microsoft documentation](https://learn.microsoft.com/en-us/dotnet/api/system.data.isolationlevel?#fields) to read more about these isolation level settings. - -## [1.5.2] / 6 April 2023 - -* [Update Akka.NET to 1.5.2](https://github.com/akkadotnet/akka.net/releases/tag/1.5.2) -* [Bump Akka.Persistence.PostgreSql to 1.5.2](https://github.com/akkadotnet/Akka.Hosting/pull/276) -* [Bump Akka.Persistence.SqlServer to 1.5.2](https://github.com/akkadotnet/Akka.Hosting/pull/276) -* [Persistence: Change persistence default serializer from json to null](https://github.com/akkadotnet/Akka.Hosting/pull/274) - -**Major Changes** -* Persistence.Hosting default value for default serializer has been changed from `json` to `null`. This only affects persistence write and not reads. All objects with no serializer mapping will now be serialized using Akka default object serializer. If you have old persistence data where they do not have their serializer ID column populated, you will need to change this setting. - -**Inherited Changes From Akka.NET Core** -* Persistence will now ignore the `serializer` setting inside journal settings when writing new events. This setting will only be used when data retrieved from the database does not have the serializer id column unpopulated. -* Cluster.Hosting, by default, will have `SplitBrainResolver` enabled. - -## [1.5.1.1] / 4 April 2023 - -* [Fix missing default DData configuration in cluster hosting extension](https://github.com/akkadotnet/Akka.Hosting/pull/272) - -## [1.5.1] / 16 March 2023 - -* [Update Akka.NET to 1.5.1](https://github.com/akkadotnet/akka.net/releases/tag/1.5.1) -* [Bump Akka.Persistence.PostgreSql to 1.5.1](https://github.com/akkadotnet/Akka.Hosting/pull/268) -* [Bump Akka.Persistence.SqlServer to 1.5.1](https://github.com/akkadotnet/Akka.Hosting/pull/268) -* [Add GetAsync method to `IRequiredActor` to resolve IActorRef in background services](https://github.com/akkadotnet/Akka.Hosting/pull/264) -* [Add cluster Distributed Data options support for Akka.Cluster.Hosting extensions](https://github.com/akkadotnet/Akka.Hosting/pull/263) - -## [1.5.0] / 2 March 2023 - -Version 1.5.0 is the RTM release of Akka.Hosting and Akka.NET v1.5.0 RTM integration. - -Full changes -* [Update Akka.NET to 1.5.0](https://github.com/akkadotnet/akka.net/releases/tag/1.5.0) -* [Fix missing cluster configuration on certain edge cases](https://github.com/akkadotnet/Akka.Hosting/pull/214) -* [Add new Cluster.Sharding RememberEntitiesStore](https://github.com/akkadotnet/Akka.Hosting/pull/224) -* [Add Cluster.Sharding journal migration adapter convenience method](https://github.com/akkadotnet/Akka.Hosting/pull/226) -* [Add LogMessageFormatter formatter support to logging](https://github.com/akkadotnet/Akka.Hosting/pull/248) - -#### Upgrading From v1.4 To v1.5 - -As noted in [the upgrade advisories](https://getakka.net/community/whats-new/akkadotnet-v1.5-upgrade-advisories.html), there was some major changes inside Akka.NET that directly affects Akka.Hosting. To upgrade from v1.4 to v1.5, please watch our video [here](https://www.youtube.com/watch?v=-UPestlIw4k) covering this process. +* [Fix ActorRegistry.GetAsync() returning Nobody](https://github.com/akkadotnet/Akka.Hosting/pull/501) \ No newline at end of file diff --git a/build.cmd b/build.cmd deleted file mode 100755 index b08cc590..00000000 --- a/build.cmd +++ /dev/null @@ -1,7 +0,0 @@ -:; set -eo pipefail -:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) -:; ${SCRIPT_DIR}/build.sh "$@" -:; exit $? - -@ECHO OFF -powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %* diff --git a/build.ps1 b/build.ps1 index bc7cab57..bc0ea6bc 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,238 +1,12 @@ -[CmdletBinding()] -Param( - [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] - [string[]]$BuildArguments -) +. "$PSScriptRoot\scripts\getReleaseNotes.ps1" +. "$PSScriptRoot\scripts\bumpVersion.ps1" -Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)" +###################################################################### +# Step 1: Grab release notes and update solution metadata +###################################################################### +$releaseNotes = Get-ReleaseNotes -MarkdownFile (Join-Path -Path $PSScriptRoot -ChildPath "RELEASE_NOTES.md") -Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 } -$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent +# inject release notes into Directory.Buil +UpdateVersionAndReleaseNotes -ReleaseNotesResult $releaseNotes -XmlFilePath (Join-Path -Path $PSScriptRoot -ChildPath "Directory.Build.props") -########################################################################### -# CONFIGURATION -########################################################################### - -$BuildProjectFile = "$PSScriptRoot\build\_build.csproj" -$TempDirectory = "$PSScriptRoot\\.nuke\temp" - -$DotNetGlobalFile = "$PSScriptRoot\\global.json" -$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1" -$DotNetChannel = "Current" - -$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1 -$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1 -$env:DOTNET_MULTILEVEL_LOOKUP = 0 - -########################################################################### -# EXECUTION -########################################################################### - -function ExecSafe([scriptblock] $cmd) { - & $cmd - if ($LASTEXITCODE) { exit $LASTEXITCODE } -} - -# If dotnet CLI is installed globally and it matches requested version, use for execution -if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and ` - $(dotnet --version) -and $LASTEXITCODE -eq 0) { - $env:DOTNET_EXE = (Get-Command "dotnet").Path -} -else { - # Download install script - $DotNetInstallFile = "$TempDirectory\dotnet-install.ps1" - New-Item -ItemType Directory -Path $TempDirectory -Force | Out-Null - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - (New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile) - - # If global.json exists, load expected version - if (Test-Path $DotNetGlobalFile) { - $DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json) - if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) { - $DotNetVersion = $DotNetGlobal.sdk.version - } - } - - # Install by channel or version - $DotNetDirectory = "$TempDirectory\dotnet-win" - if (!(Test-Path variable:DotNetVersion)) { - ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath } - } else { - ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath } - } - $env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe" -} - -Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)" - -ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet } -ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments } - -# SIG # Begin signature block -# MIIe/AYJKoZIhvcNAQcCoIIe7TCCHukCAQExDzANBglghkgBZQMEAgEFADB5Bgor -# BgEEAYI3AgEE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sdWQqlL71EkMJu/eOsEk7vA/HXH3BQvpvXUY7LYzW7fL395ieQgFPa -# sxTGPxEyHH9K1ArYPJjXNz6Zuk9tLx2YnUsGG9A4J1MUTGEExTkA9tJmXi9rmjl4 -# XsNQxsevZubBhKjm1XR7GeWMNnKLXBtPDh5fQsiFmqKoC7caVrsIXztwqK4FMIA8 -# N7ZuwIBQAastH+O3gvCIvCcU7i50fCrY5z0wDZFo/7wTk7hKkN4Njzjad0e5XTZu -# wOSzmyU4OhO0QSHKn9oRvQ== -# SIG # End signature block +Write-Output "Added release notes $releaseNotes" \ No newline at end of file diff --git a/build.sh b/build.sh deleted file mode 100755 index e8961f99..00000000 --- a/build.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash - -bash --version 2>&1 | head -n 1 - -set -eo pipefail -SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) - -########################################################################### -# CONFIGURATION -########################################################################### - -BUILD_PROJECT_FILE="$SCRIPT_DIR/build/_build.csproj" -TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp" - -DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json" -DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh" -DOTNET_CHANNEL="Current" - -export DOTNET_CLI_TELEMETRY_OPTOUT=1 -export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -export DOTNET_MULTILEVEL_LOOKUP=0 - -########################################################################### -# EXECUTION -########################################################################### - -function FirstJsonValue { - perl -nle 'print $1 if m{"'"$1"'": "([^"]+)",?}' <<< "${@:2}" -} - -# If dotnet CLI is installed globally and it matches requested version, use for execution -if [ -x "$(command -v dotnet)" ] && dotnet --version &>/dev/null; then - export DOTNET_EXE="$(command -v dotnet)" -else - # Download install script - DOTNET_INSTALL_FILE="$TEMP_DIRECTORY/dotnet-install.sh" - mkdir -p "$TEMP_DIRECTORY" - curl -Lsfo "$DOTNET_INSTALL_FILE" "$DOTNET_INSTALL_URL" - chmod +x "$DOTNET_INSTALL_FILE" - - # If global.json exists, load expected version - if [[ -f "$DOTNET_GLOBAL_FILE" ]]; then - DOTNET_VERSION=$(FirstJsonValue "version" "$(cat "$DOTNET_GLOBAL_FILE")") - if [[ "$DOTNET_VERSION" == "" ]]; then - unset DOTNET_VERSION - fi - fi - - # Install by channel or version - DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix" - if [[ -z ${DOTNET_VERSION+x} ]]; then - "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --channel "$DOTNET_CHANNEL" --no-path - else - "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path - fi - export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet" -fi - -echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)" - -"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet -"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@" diff --git a/build/.editorconfig b/build/.editorconfig deleted file mode 100644 index 31e43dcd..00000000 --- a/build/.editorconfig +++ /dev/null @@ -1,11 +0,0 @@ -[*.cs] -dotnet_style_qualification_for_field = false:warning -dotnet_style_qualification_for_property = false:warning -dotnet_style_qualification_for_method = false:warning -dotnet_style_qualification_for_event = false:warning -dotnet_style_require_accessibility_modifiers = never:warning - -csharp_style_expression_bodied_methods = true:silent -csharp_style_expression_bodied_properties = true:warning -csharp_style_expression_bodied_indexers = true:warning -csharp_style_expression_bodied_accessors = true:warning diff --git a/build/Build.CI.GitHubActions.cs b/build/Build.CI.GitHubActions.cs deleted file mode 100644 index 17f3c238..00000000 --- a/build/Build.CI.GitHubActions.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2021 Maintainers of NUKE. -// Distributed under the MIT License. -// https://github.com/nuke-build/nuke/blob/master/LICENSE - -using System; -using System.Collections.Generic; -using Nuke.Common.CI.GitHubActions; -using Nuke.Common.CI.GitHubActions.Configuration; -using Nuke.Common.Execution; -using Nuke.Common.Utilities; - -[CustomGitHubActions("pr_validation", - GitHubActionsImage.WindowsLatest, - GitHubActionsImage.UbuntuLatest, - AutoGenerate = false, - OnPushBranches = new[] { "master", "dev", "v1.*" }, - OnPullRequestBranches = new[] { "master", "dev", "v1.*" }, - InvokedTargets = new[] { nameof(All) }, - PublishArtifacts = true, - EnableGitHubToken = true)] - -[CustomGitHubActions("Windows_release", - GitHubActionsImage.WindowsLatest, - OnPushTags = new[] { "*" }, - AutoGenerate = false, - InvokedTargets = new[] { nameof(NuGet) }, - ImportSecrets = new[] { "Nuget_Key" }, - PublishArtifacts = true, - EnableGitHubToken = true) -] - -partial class Build -{ -} -class CustomGitHubActionsAttribute : GitHubActionsAttribute -{ - public CustomGitHubActionsAttribute(string name, GitHubActionsImage image, params GitHubActionsImage[] images) : base(name, image, images) - { - } - - protected override GitHubActionsJob GetJobs(GitHubActionsImage image, IReadOnlyCollection relevantTargets) - { - var job = base.GetJobs(image, relevantTargets); - var newSteps = new List(job.Steps); - foreach (var version in new[] { "6.0.*", "5.0.*" }) - { - newSteps.Insert(1, new GitHubActionsSetupDotNetStep - { - Version = version - }); - } - newSteps.Insert(1, new GitHubActionsSetupChmod - { - File = "build.cmd" - }); - newSteps.Insert(1, new GitHubActionsSetupChmod - { - File = "build.sh" - }); - job.Steps = newSteps.ToArray(); - return job; - } -} - -class GitHubActionsSetupDotNetStep : GitHubActionsStep -{ - public string Version { get; init; } - - public override void Write(CustomFileWriter writer) - { - writer.WriteLine("- uses: actions/setup-dotnet@v1"); - - using (writer.Indent()) - { - writer.WriteLine("with:"); - using (writer.Indent()) - { - writer.WriteLine($"dotnet-version: {Version}"); - } - } - } -} - -class GitHubActionsSetupChmod : GitHubActionsStep -{ - public string File { get; init; } - - public override void Write(CustomFileWriter writer) - { - writer.WriteLine($"- name: Make {File} executable"); - using (writer.Indent()) - { - writer.WriteLine($"run: chmod +x ./{File}"); - } - } -} \ No newline at end of file diff --git a/build/Build.cs b/build/Build.cs deleted file mode 100644 index 493e43c1..00000000 --- a/build/Build.cs +++ /dev/null @@ -1,431 +0,0 @@ -using System; -using System.Linq; -using Nuke.Common; -using Nuke.Common.CI; -using Nuke.Common.Execution; -using Nuke.Common.Git; -using Nuke.Common.IO; -using Nuke.Common.ProjectModel; -using Nuke.Common.Tooling; -using Nuke.Common.Tools.DotNet; -using Nuke.Common.Tools.GitVersion; -using Nuke.Common.Utilities.Collections; -using static Nuke.Common.IO.FileSystemTasks; -using static Nuke.Common.IO.PathConstruction; -using static Nuke.Common.Tools.DotNet.DotNetTasks; -using static Nuke.Common.Tools.DocFX.DocFXTasks; -using System.IO; -using Nuke.Common.ChangeLog; -using Nuke.Common.Tools.DocFX; -using Nuke.Common.Tools.Docker; -using static Nuke.Common.Tools.SignClient.SignClientTasks; -using Nuke.Common.Tools.SignClient; -using Octokit; -using Nuke.Common.Utilities; -using Nuke.Common.CI.GitHubActions; - -[ShutdownDotNetAfterServerBuild] -[DotNetVerbosityMapping] -[UnsetVisualStudioEnvironmentVariables] -partial class Build : NukeBuild -{ - /// Support plugins are available for: - /// - JetBrains ReSharper https://nuke.build/resharper - /// - JetBrains Rider https://nuke.build/rider - /// - Microsoft VisualStudio https://nuke.build/visualstudio - /// - Microsoft VSCode https://nuke.build/vscode - - public static int Main() => Execute(x => x.Install); - - [Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")] - readonly Configuration Configuration = Configuration.Release; - - [GitRepository] readonly GitRepository GitRepository; - - [Parameter] string NugetPublishUrl = "https://api.nuget.org/v3/index.json"; - - [Parameter][Secret] string NugetKey; - - [Parameter] int Port = 8090; - - [Parameter] string SymbolsPublishUrl; - - //usage: - //./build.cmd createnuget --NugetPrerelease {suffix} - [Parameter] string NugetPrerelease; - - // Metadata used when signing packages and DLLs - [Parameter] string SigningName = "My Library"; - [Parameter] string SigningDescription = "My REALLY COOL Library"; - [Parameter] string SigningUrl = "https://signing.is.cool/"; - - //usage: - //./build.cmd runtests --test-timeout 300s - [Parameter] string TestTimeout = "30m"; - - [Parameter][Secret] string SignClientSecret; - [Parameter][Secret] string SignClientUser; - // Directories - AbsolutePath ToolsDir => RootDirectory / "tools"; - AbsolutePath Output => RootDirectory / "bin"; - AbsolutePath OutputNuget => Output / "nuget"; - AbsolutePath OutputTests => RootDirectory / "TestResults"; - AbsolutePath OutputPerfTests => RootDirectory / "PerfResults"; - AbsolutePath SourceDirectory => RootDirectory / "src"; - AbsolutePath DocSiteDirectory => RootDirectory / "docs" / "_site"; - public string ChangelogFile => RootDirectory / "RELEASE_NOTES.md"; - public AbsolutePath DocFxDir => RootDirectory / "docs"; - public AbsolutePath DocFxDirJson => DocFxDir / "docfx.json"; - readonly Solution Solution = ProjectModelTasks.ParseSolution(RootDirectory.GlobFiles("*.sln").FirstOrDefault()); - GitHubActions GitHubActions => GitHubActions.Instance; - private long BuildNumber() - { - if (GitHubActions != null!) - return GitHubActions.RunNumber; - - return 0; - } - private string PreReleaseVersionSuffix() - { - return "beta" + (BuildNumber() > 0 ? BuildNumber() : DateTime.UtcNow.Ticks.ToString()); - } - public ChangeLog Changelog => MdHelper.ReadChangelog(ChangelogFile); - - public ReleaseNotes ReleaseNotes => Changelog.ReleaseNotes.OrderByDescending(s => s.Version).FirstOrDefault() ?? throw new ArgumentException("Bad Changelog File. Version Should Exist"); - - private string VersionFromReleaseNotes => ReleaseNotes.Version.IsPrerelease ? ReleaseNotes.Version.OriginalVersion : ""; - private string VersionSuffix => NugetPrerelease == "dev" ? PreReleaseVersionSuffix() : NugetPrerelease == "" ? VersionFromReleaseNotes : NugetPrerelease; - public string ReleaseVersion => ReleaseNotes.Version?.ToString() ?? throw new ArgumentException("Bad Changelog File. Define at least one version"); - GitHubClient GitHubClient; - Target Clean => _ => _ - .Description("Cleans all the output directories") - .Before(Restore) - .Executes(() => - { - RootDirectory - .GlobDirectories("src/**/bin", "src/**/obj", Output, OutputTests, OutputPerfTests, OutputNuget, DocSiteDirectory) - .ForEach(DeleteDirectory); - EnsureCleanDirectory(Output); - }); - - Target Restore => _ => _ - .Description("Restores all nuget packages") - .DependsOn(Clean) - .Executes(() => - { - DotNetRestore(s => s - .SetProjectFile(Solution)); - }); - - Target CreateNuget => _ => _ - .Unlisted() - .Description("Creates nuget packages") - .DependsOn(Compile) - .Executes(() => - { - var version = Version(ReleaseNotes, NugetPrerelease); - var releaseNotes = MdHelper.GetNuGetReleaseNotes(ChangelogFile, GitRepository); - var versionSuffix = VersionSuffix; - var projects = SourceDirectory.GlobFiles("**/*.csproj") - .Except(SourceDirectory.GlobFiles("**/*Tests.csproj", "**/*Tests*.csproj", "**/*Demo.csproj", "**/*Sample.csproj")); - foreach (var project in projects) - { - DotNetPack(s => s - .SetProject(project) - .SetConfiguration(Configuration) - .EnableNoBuild() - .SetIncludeSymbols(true) - .EnableNoRestore() - .SetAssemblyVersion(version) - .SetFileVersion(version) - .SetVersionPrefix(version) - .SetVersionSuffix(versionSuffix) - .SetPackageReleaseNotes(releaseNotes) - .SetOutputDirectory(OutputNuget)); - } - - }); - Target PublishNuget => _ => _ - .Unlisted() - .Description("Publishes .nuget packages to Nuget") - .After(CreateNuget, SignClient) - .OnlyWhenDynamic(() => !NugetPublishUrl.IsNullOrWhiteSpace()) - .OnlyWhenDynamic(() => !NugetKey.IsNullOrWhiteSpace()) - .Triggers(GitHubRelease) - .Executes(() => - { - var packages = OutputNuget.GlobFiles("*.nupkg", "*.symbols.nupkg").NotNull(); - var shouldPublishSymbolsPackages = !string.IsNullOrWhiteSpace(SymbolsPublishUrl); - foreach (var package in packages) - { - if (shouldPublishSymbolsPackages) - { - DotNetNuGetPush(s => s - .SetTimeout(TimeSpan.FromMinutes(10).Minutes) - .SetTargetPath(package) - .SetSource(NugetPublishUrl) - .SetSymbolSource(SymbolsPublishUrl) - .SetApiKey(NugetKey)); - } - else - { - DotNetNuGetPush(s => s - .SetTimeout(TimeSpan.FromMinutes(10).Minutes) - .SetTargetPath(package) - .SetSource(NugetPublishUrl) - .SetApiKey(NugetKey)); - } - - } - }); - Target AuthenticatedGitHubClient => _ => _ - .Unlisted() - .OnlyWhenDynamic(() => GitHubActions != null && !string.IsNullOrWhiteSpace(GitHubActions.Token)) - .Executes(() => - { - GitHubClient = new GitHubClient(new ProductHeaderValue("nuke-build")) - { - Credentials = new Credentials(GitHubActions.Token, AuthenticationType.Bearer) - }; - }); - Target GitHubRelease => _ => _ - .Unlisted() - .Description("Creates a GitHub release (or amends existing) and uploads the artifact") - .OnlyWhenDynamic(() => GitHubActions != null && !string.IsNullOrWhiteSpace(GitHubActions.Token)) - .DependsOn(AuthenticatedGitHubClient) - .Executes(async () => - { - var version = ReleaseNotes.Version.ToString(); - var releaseNotes = MdHelper.GetNuGetReleaseNotes(ChangelogFile); - Release release; - var releaseName = $"{version}"; - - if (!VersionSuffix.IsNullOrWhiteSpace()) - releaseName = $"{version}-{VersionSuffix}"; - - var identifier = GitRepository.Identifier.Split("/"); - - var (gitHubOwner, repoName) = (identifier[0], identifier[1]); - try - { - release = await GitHubClient.Repository.Release.Get(gitHubOwner, repoName, releaseName); - } - catch (NotFoundException) - { - var newRelease = new NewRelease(releaseName) - { - Body = releaseNotes, - Name = releaseName, - Draft = false, - Prerelease = GitRepository.IsOnReleaseBranch() - }; - release = await GitHubClient.Repository.Release.Create(gitHubOwner, repoName, newRelease); - } - - foreach (var existingAsset in release.Assets) - { - await GitHubClient.Repository.Release.DeleteAsset(gitHubOwner, repoName, existingAsset.Id); - } - - Information($"GitHub Release {releaseName}"); - var packages = OutputNuget.GlobFiles("*.nupkg", "*.symbols.nupkg").NotNull(); - foreach (var artifact in packages) - { - var releaseAssetUpload = new ReleaseAssetUpload(artifact.Name, "application/zip", File.OpenRead(artifact), null); - var releaseAsset = await GitHubClient.Repository.Release.UploadAsset(release, releaseAssetUpload); - Information($" {releaseAsset.BrowserDownloadUrl}"); - } - }); - Target RunTests => _ => _ - .Description("Runs all the unit tests") - .DependsOn(Compile) - .Executes(() => - { - var projects = Solution.GetProjects("*.Tests"); - foreach (var project in projects) - { - Information($"Running tests from {project}"); - foreach (var fw in project.GetTargetFrameworks()) - { - Information($"Running for {project} ({fw}) ..."); - DotNetTest(c => c - .SetProjectFile(project) - .SetConfiguration(Configuration.ToString()) - .SetFramework(fw) - .SetResultsDirectory(OutputTests) - .SetProcessWorkingDirectory(Directory.GetParent(project).FullName) - .SetLoggers("trx") - .SetBlameCrash(true) - .SetBlameHang(true) - .SetBlameHangTimeout(TestTimeout) - .SetVerbosity(verbosity: DotNetVerbosity.Normal) - .EnableNoBuild()); - } - } - }); - Target SignClient => _ => _ - .Unlisted() - .After(CreateNuget) - .Before(PublishNuget) - .OnlyWhenDynamic(() => !SignClientSecret.IsNullOrWhiteSpace() && !SignClientUser.IsNullOrWhiteSpace()) - .Executes(() => - { - var assemblies = OutputNuget.GlobFiles("*.nupkg"); - foreach (var asm in assemblies) - { - SignClientSign(s => s - .SetProcessToolPath(ToolsDir / "SignClient.exe") - .SetProcessLogOutput(true) - .SetConfig(RootDirectory / "appsettings.json") - .SetDescription(SigningDescription) - .SetDescriptionUrl(SigningUrl) - .SetInput(asm) - .SetName(SigningName) - .SetSecret(SignClientSecret) - .SetUsername(SignClientUser) - .SetProcessWorkingDirectory(RootDirectory) - .SetProcessExecutionTimeout(TimeSpan.FromMinutes(5).Minutes)); - - //SignClient(stringBuilder.ToString(), workingDirectory: RootDirectory, timeout: TimeSpan.FromMinutes(5).Minutes); - } - }); - Target Nuget => _ => _ - .DependsOn(CreateNuget, SignClient, PublishNuget); - private AbsolutePath[] GetDockerProjects() - { - return SourceDirectory.GlobFiles("**/Dockerfile")// folders with Dockerfiles in it - .ToArray(); - } - Target PublishCode => _ => _ - .Unlisted() - .Description("Publish project as release") - .DependsOn(RunTests) - .Executes(() => - { - var dockfiles = GetDockerProjects(); - foreach (var dockfile in dockfiles) - { - Information(dockfile.Parent.ToString()); - var project = dockfile.Parent.GlobFiles("*.csproj").First(); - DotNetPublish(s => s - .SetProject(project) - .SetConfiguration(Configuration.Release)); - } - }); - Target All => _ => _ - .Description("Executes NBench, Tests and Nuget targets/commands") - .DependsOn(BuildRelease, RunTests, NBench, CreateNuget); - - Target NBench => _ => _ - .Description("Runs all BenchMarkDotNet tests") - .DependsOn(Compile) - .Executes(() => - { - RootDirectory - .GlobFiles("src/**/*.Tests.Performance.csproj") - .ForEach(path => - { - DotNetRun(s => s - .SetApplicationArguments($"--no-build -c release --concurrent true --trace true --output {OutputPerfTests} --diagnostic") - .SetProcessLogOutput(true) - .SetProcessWorkingDirectory(Directory.GetParent(path).FullName) - .SetProcessExecutionTimeout((int)TimeSpan.FromMinutes(15).TotalMilliseconds) - ); - }); - }); - //-------------------------------------------------------------------------------- - // Documentation - //-------------------------------------------------------------------------------- - Target DocsInit => _ => _ - .Unlisted() - .DependsOn(Compile) - .Executes(() => - { - DocFXInit(s => s.SetOutputFolder(DocFxDir).SetQuiet(true)); - }); - Target DocsMetadata => _ => _ - .Unlisted() - .Description("Create DocFx metadata") - .DependsOn(BuildRelease) - .Executes(() => - { - DocFXMetadata(s => s - .SetProjects(DocFxDirJson) - .SetLogLevel(DocFXLogLevel.Verbose)); - }); - - Target DocFx => _ => _ - .Description("Builds Documentation") - .DependsOn(DocsMetadata) - .Executes(() => - { - DocFXBuild(s => s - .SetConfigFile(DocFxDirJson) - .SetLogLevel(DocFXLogLevel.Verbose)); - }); - - Target ServeDocs => _ => _ - .Description("Build and preview documentation") - .DependsOn(DocFx) - .Executes(() => DocFXServe(s => s.SetFolder(DocFxDir).SetPort(Port))); - - Target Compile => _ => _ - .Description("Builds all the projects in the solution") - .DependsOn(AssemblyInfo, Restore) - .Executes(() => - { - var version = ReleaseNotes.Version.ToString(); - DotNetBuild(s => s - .SetProjectFile(Solution) - .SetConfiguration(Configuration) - .EnableNoRestore()); - }); - - Target BuildRelease => _ => _ - .DependsOn(Compile); - - Target AssemblyInfo => _ => _ - .After(Restore) - .Executes(() => - { - XmlHelper.XmlPoke(SourceDirectory / "Directory.Build.props", "//Project/PropertyGroup/PackageReleaseNotes", MdHelper.GetNuGetReleaseNotes(ChangelogFile)); - XmlTasks.XmlPoke(SourceDirectory / "Directory.Build.props", "//Project/PropertyGroup/VersionPrefix", ReleaseVersion); - - }); - - Target Install => _ => _ - .Description("Install `Nuke.GlobalTool` and SignClient") - .Executes(() => - { - try - { - DotNet($@"dotnet tool install SignClient --version 1.3.155 --tool-path ""{ToolsDir}"" "); - } - catch (ProcessException pex) - { - if (!pex.Message.Contains("is already installed")) - throw; - } - - try - { - DotNet($"tool install Nuke.GlobalTool --global"); - } - catch (ProcessException pex) - { - if (!pex.Message.Contains("is already installed")) - throw; - } - }).ProceedAfterFailure(); - - static void Information(string info) - { - Serilog.Log.Information(info); - } - static string Version(ReleaseNotes releaseNotes, string nugetPrerelease) - { - var version = releaseNotes.Version.ToString(); - version = nugetPrerelease == "dev" ? version.Split('-')[0] : version; - return version; - } -} diff --git a/build/Configuration.cs b/build/Configuration.cs deleted file mode 100644 index 9c08b1ae..00000000 --- a/build/Configuration.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.ComponentModel; -using System.Linq; -using Nuke.Common.Tooling; - -[TypeConverter(typeof(TypeConverter))] -public class Configuration : Enumeration -{ - public static Configuration Debug = new Configuration { Value = nameof(Debug) }; - public static Configuration Release = new Configuration { Value = nameof(Release) }; - - public static implicit operator string(Configuration configuration) - { - return configuration.Value; - } -} diff --git a/build/Directory.Build.props b/build/Directory.Build.props deleted file mode 100644 index e147d635..00000000 --- a/build/Directory.Build.props +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/build/Directory.Build.targets b/build/Directory.Build.targets deleted file mode 100644 index 25326095..00000000 --- a/build/Directory.Build.targets +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/build/MdHelper.cs b/build/MdHelper.cs deleted file mode 100644 index 22e081de..00000000 --- a/build/MdHelper.cs +++ /dev/null @@ -1,175 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright 2021 Maintainers of NUKE. -// Copyright (C) 2013-2022 .NET Foundation -// Distributed under the MIT License. -// https://github.com/nuke-build/nuke/blob/master/LICENSE -// -// ----------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using JetBrains.Annotations; -using NuGet.Versioning; -using Nuke.Common; -using Nuke.Common.ChangeLog; -using Nuke.Common.Git; -using Nuke.Common.IO; -using Nuke.Common.Tools.GitHub; -using Nuke.Common.Utilities; -using Serilog; - -public static class MdHelper -{ - public static string GetNuGetReleaseNotes(string changelogFile, GitRepository repository = null) - { - var changelogSectionNotes = ExtractChangelogSectionNotes(changelogFile) - .Select(x => x.Replace("- ", "\u2022 ") - .Replace("* ", "\u2022 ") - .Replace("+ ", "\u2022 ") - .Replace("`", string.Empty) - .Replace(",", "%2C") - .Replace(";", "%3B")).ToList(); - - if (repository.IsGitHubRepository()) - { - changelogSectionNotes.Add(string.Empty); - changelogSectionNotes.Add($"Full changelog at {repository.GetGitHubBrowseUrl(changelogFile)}"); - } - - return changelogSectionNotes.JoinNewLine(); - } - - /// - /// Extracts the notes of the specified changelog section. - /// - /// The path to the changelog file. - /// The tag which release notes should get extracted. - /// A collection of the release notes. - [Pure] - public static IEnumerable ExtractChangelogSectionNotes(string changelogFile, string tag = null) - { - var content = TextTasks.ReadAllLines(changelogFile).Where(x => !string.IsNullOrWhiteSpace(x)).ToList(); - var sections = GetReleaseSections(content); - var section = tag == null - ? sections.First(x => x.StartIndex < x.EndIndex) - : sections.First(x => x.Caption.EqualsOrdinalIgnoreCase(tag)).NotNull($"Could not find release section for '{tag}'."); - - return content - .Skip(section.StartIndex + 1) - .Take(section.EndIndex - section.StartIndex); - } - - /// - /// Reads the specified changelog. - /// - /// The path to the changelog file. - /// A object to work with the changelog. - [Pure] - public static ChangeLog ReadChangelog(string changelogFile) - { - var releaseNotes = ReadReleaseNotes(changelogFile); - var unreleased = releaseNotes.Where(x => x.Unreleased).ToArray(); - - if (unreleased.Length > 0) - { - Assert.True(unreleased.Length == 1, "Changelog should have only one draft section"); - return new ChangeLog(changelogFile, unreleased.First(), releaseNotes); - } - - Assert.True(releaseNotes.Count(x => !x.Unreleased) >= 1, "Changelog should have at lease one released version section"); - return new ChangeLog(changelogFile, releaseNotes); - } - - /// - /// Reads the release notes from the given changelog file and returns the result. - /// - /// The path to the changelog file. - /// A readonly list of the release sections contained in the changelog. - [Pure] - public static IReadOnlyList ReadReleaseNotes(string changelogFile) - { - var lines = TextTasks.ReadAllLines(changelogFile).ToList(); - var releaseSections = GetReleaseSections(lines).ToList(); - - Assert.True(releaseSections.Any(), "Changelog should have at least one release note section"); - return releaseSections.Select(Parse).ToList().AsReadOnly(); - - ReleaseNotes Parse(ReleaseSection section) - { - var releaseNotes = lines - .Skip(section.StartIndex + 1) - .Take(section.EndIndex - section.StartIndex) - .ToList() - .AsReadOnly(); - - return NuGetVersion.TryParse(section.Caption, out var version) - ? new ReleaseNotes(version, releaseNotes, section.StartIndex, section.EndIndex) - : new ReleaseNotes(releaseNotes, section.StartIndex, section.EndIndex); - } - } - - private static IEnumerable GetReleaseSections(List content) - { - static bool IsReleaseHead(string str) - => str.StartsWith("## "); - - static string GetCaption(string str) - => str - .TrimStart('#', ' ', '[') - .Split(' ') - .First() - .TrimEnd(']'); - - var index = 0; - while (index < content.Count) - { - string caption; - while (true) - { - var line = content[index]; - if (IsReleaseHead(line)) - { - caption = GetCaption(line); - break; - } - index++; - if (index == content.Count) - yield break; - } - - var startIndex = index; - while (index < content.Count) - { - index++; - string line = null; - if (index < content.Count) - line = content[index]; - - if (index == content.Count || IsReleaseHead(line)) - { - var releaseData = new ReleaseSection - { - Caption = caption, - StartIndex = startIndex, - EndIndex = index -1 - }; - Log.Verbose("Found section '{Caption}' [{Start}-{End}]", caption, index, releaseData.EndIndex); - - yield return releaseData; - break; - } - } - } - } - - [DebuggerDisplay("{" + nameof(Caption) + "} [{" + nameof(StartIndex) + "}-{" + nameof(EndIndex) + "}]")] - private class ReleaseSection - { - public string Caption; - public int StartIndex; - public int EndIndex; - } -} diff --git a/build/XmlHelper.cs b/build/XmlHelper.cs deleted file mode 100644 index 7a92b0db..00000000 --- a/build/XmlHelper.cs +++ /dev/null @@ -1,73 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright 2021 Maintainers of NUKE. -// Copyright (C) 2013-2022 .NET Foundation -// Distributed under the MIT License. -// https://github.com/nuke-build/nuke/blob/master/LICENSE -// -// ----------------------------------------------------------------------- - -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml; -using System.Xml.Linq; -using System.Xml.XPath; -using Nuke.Common; - -public static class XmlHelper -{ - public static void XmlPoke(string path, string xpath, string value, params (string prefix, string uri)[] namespaces) - { - XmlPoke(path, xpath, value, Encoding.UTF8, namespaces); - } - - public static void XmlPoke(string path, string xpath, string value, Encoding encoding, params (string prefix, string uri)[] namespaces) - { - var document = XDocument.Load(path, LoadOptions.PreserveWhitespace); - var (elements, attributes) = GetObjects(document, xpath, namespaces); - Assert.True((elements.Count == 1 || attributes.Count == 1) && !(elements.Count == 0 && attributes.Count == 0)); - - if (value.Contains('<') || value.Contains('>')) - { - elements.SingleOrDefault()?.SetValue(""); - elements.SingleOrDefault()?.RemoveAll(); - elements.SingleOrDefault()?.Add(new XCData(value)); - attributes.SingleOrDefault()?.SetValue(value); - } - else - { - elements.SingleOrDefault()?.SetValue(value); - attributes.SingleOrDefault()?.SetValue(value); - } - - var writerSettings = new XmlWriterSettings { OmitXmlDeclaration = document.Declaration == null, Encoding = encoding }; - using var xmlWriter = XmlWriter.Create(path, writerSettings); - document.Save(xmlWriter); - } - - private static (IReadOnlyCollection Elements, IReadOnlyCollection Attributes) GetObjects( - XDocument document, - string xpath, - params (string prefix, string uri)[] namespaces) - { - XmlNamespaceManager xmlNamespaceManager = null; - - if (namespaces?.Length > 0) - { - var reader = document.CreateReader(); - if (reader.NameTable != null) - { - xmlNamespaceManager = new XmlNamespaceManager(reader.NameTable); - foreach (var (prefix, uri) in namespaces) - xmlNamespaceManager.AddNamespace(prefix, uri); - } - } - - var objects = ((IEnumerable) document.XPathEvaluate(xpath, xmlNamespaceManager)).Cast().ToList(); - return (objects.OfType().ToList().AsReadOnly(), - objects.OfType().ToList().AsReadOnly()); - } - -} \ No newline at end of file diff --git a/build/_build.csproj b/build/_build.csproj deleted file mode 100644 index 76fd346d..00000000 --- a/build/_build.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - Exe - net6.0 - - CS0649;CS0169 - .. - .. - 1 - - - - - - - - diff --git a/build/_build.csproj.DotSettings b/build/_build.csproj.DotSettings deleted file mode 100644 index 337271da..00000000 --- a/build/_build.csproj.DotSettings +++ /dev/null @@ -1,30 +0,0 @@ - - DO_NOT_SHOW - DO_NOT_SHOW - DO_NOT_SHOW - DO_NOT_SHOW - Implicit - Implicit - ExpressionBody - 0 - NEXT_LINE - True - False - 120 - IF_OWNER_IS_SINGLE_LINE - WRAP_IF_LONG - False - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy><Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> - <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> - True - True - True - True - True - True - True - True - True - True diff --git a/global.json b/global.json new file mode 100644 index 00000000..16cb9bc1 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "rollForward": "latestMinor", + "version": "8.0.302" + } +} \ No newline at end of file diff --git a/scripts/bumpVersion.ps1 b/scripts/bumpVersion.ps1 new file mode 100644 index 00000000..cdc46edf --- /dev/null +++ b/scripts/bumpVersion.ps1 @@ -0,0 +1,28 @@ +function UpdateVersionAndReleaseNotes { + param ( + [Parameter(Mandatory=$true)] + [PSCustomObject]$ReleaseNotesResult, + + [Parameter(Mandatory=$true)] + [string]$XmlFilePath + ) + + # Load XML + $xmlContent = New-Object XML + $xmlContent.Load($XmlFilePath) + + # Update VersionPrefix and PackageReleaseNotes + $versionPrefixElement = $xmlContent.SelectSingleNode("//VersionPrefix") + $versionPrefixElement.InnerText = $ReleaseNotesResult.Version + + $packageReleaseNotesElement = $xmlContent.SelectSingleNode("//PackageReleaseNotes") + $packageReleaseNotesElement.InnerText = $ReleaseNotesResult.ReleaseNotes + + # Save the updated XML + $xmlContent.Save($XmlFilePath) +} + +# Usage example: +# $notes = Get-ReleaseNotes -MarkdownFile "$PSScriptRoot\RELEASE_NOTES.md" +# $propsPath = Join-Path -Path (Get-Item $PSScriptRoot).Parent.FullName -ChildPath "Directory.Build.props" +# UpdateVersionAndReleaseNotes -ReleaseNotesResult $notes -XmlFilePath $propsPath diff --git a/scripts/getReleaseNotes.ps1 b/scripts/getReleaseNotes.ps1 new file mode 100644 index 00000000..419d85fc --- /dev/null +++ b/scripts/getReleaseNotes.ps1 @@ -0,0 +1,44 @@ +function Get-ReleaseNotes { + param ( + [Parameter(Mandatory=$true)] + [string]$MarkdownFile + ) + + # Read markdown file content + $content = Get-Content -Path $MarkdownFile -Raw + + # Split content based on headers + $sections = $content -split "####" + + # Output object to store result + $outputObject = [PSCustomObject]@{ + Version = $null + Date = $null + ReleaseNotes = $null + } + + # Check if we have at least 3 sections (1. Before the header, 2. Header, 3. Release notes) + if ($sections.Count -ge 3) { + $header = $sections[1].Trim() + $releaseNotes = $sections[2].Trim() + + # Extract version and date from the header + $headerParts = $header -split " ", 2 + if ($headerParts.Count -eq 2) { + $outputObject.Version = $headerParts[0] + $outputObject.Date = $headerParts[1] + } + + $outputObject.ReleaseNotes = $releaseNotes + } + + # Return the output object + return $outputObject +} + +# Call function example: +#$result = Get-ReleaseNotes -MarkdownFile "$PSScriptRoot\RELEASE_NOTES.md" +#Write-Output "Version: $($result.Version)" +#Write-Output "Date: $($result.Date)" +#Write-Output "Release Notes:" +#Write-Output $result.ReleaseNotes diff --git a/src/Akka.Hosting.TestKit/Akka.Hosting.TestKit.csproj b/src/Akka.Hosting.TestKit/Akka.Hosting.TestKit.csproj index 7c405499..07557b03 100644 --- a/src/Akka.Hosting.TestKit/Akka.Hosting.TestKit.csproj +++ b/src/Akka.Hosting.TestKit/Akka.Hosting.TestKit.csproj @@ -5,6 +5,7 @@ $(LibraryFramework) true true + false diff --git a/src/Directory.Build.props b/src/Directory.Build.props deleted file mode 100644 index e31225f9..00000000 --- a/src/Directory.Build.props +++ /dev/null @@ -1,50 +0,0 @@ - - - Copyright © 2013-2023 Akka.NET Team - Akka.NET Team - 1.5.19 - • [Update Akka.NET to 1.5.19](https://github.com/akkadotnet/akka.net/releases/tag/1.5.19) - akkalogo.png - - https://github.com/akkadotnet/Akka.Hosting - - Apache-2.0 - $(NoWarn);CS1591 - README.md - - - - 10.0 - enable - - - - netstandard2.0 - net6.0 - 2.8.1 - 17.11.1 - 6.0.2 - 2.8.1 - 1.5.30 - [6.0.0,) - - - - - - - - - - - - - - true - - true - - true - snupkg - -