Skip to content

Commit

Permalink
1.5 upgrade (#321)
Browse files Browse the repository at this point in the history
* upgraded to Akka.NET v1.5

* added centralized package management

* fixed serilog package reference

* upgraded to .NET 7.0

* fixed the test project .NET verison

* Update Directory.Build.props

* Update Directory.Packages.props

* update build scripts to target .NET 7.0
  • Loading branch information
Aaronontheweb authored Apr 7, 2023
1 parent c77bbeb commit e9907ce
Show file tree
Hide file tree
Showing 15 changed files with 89 additions and 50 deletions.
14 changes: 14 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>

<packageSourceMapping>
<packageSource key="nuget">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
6 changes: 2 additions & 4 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#### 1.7.2 December 20 2022 ####
#### 1.8.0 March 02 2023 ####

* [Bumped Akka.NET version to 1.4.47](https://github.com/akkadotnet/akka.net/releases/tag/1.4.47)
* [Added Serilog logging, configurable by `/app/serilog.json`](https://github.com/petabridge/lighthouse/pull/304)
* [Upgraded to Petabridge.Cmd 1.2.1](https://cmd.petabridge.com/articles/RELEASE_NOTES.html) and used Akka.Hosting support.
* [Bumped Akka.NET version to 1.5.0](https://github.com/akkadotnet/akka.net/releases/tag/1.5.0)
4 changes: 2 additions & 2 deletions build-system/azure-pipeline.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
persistCredentials: true
- task: UseDotNet@2
displayName: 'Use .NET 6 SDK 6.0.100'
displayName: 'Use .NET 7'
inputs:
version: 6.0.100
version: 7.x
# Linux or macOS
- script: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
displayName: Docker - Register QEMU
Expand Down
4 changes: 2 additions & 2 deletions build-system/windows-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
demands: Cmd
steps:
- task: UseDotNet@2
displayName: 'Use .NET 6 SDK 6.0.100'
displayName: 'Use .NET 7 SDK'
inputs:
version: 6.0.100
version: 7.x
- task: BatchScript@1
displayName: 'dotnet publish'
inputs:
Expand Down
4 changes: 2 additions & 2 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ Target "Clean" (fun _ ->
)

Target "AssemblyInfo" (fun _ ->
XmlPokeInnerText "./src/common.props" "//Project/PropertyGroup/VersionPrefix" releaseNotes.AssemblyVersion
XmlPokeInnerText "./src/common.props" "//Project/PropertyGroup/PackageReleaseNotes" (releaseNotes.Notes |> String.concat "\n")
XmlPokeInnerText "./src/Directory.Build.props" "//Project/PropertyGroup/VersionPrefix" releaseNotes.AssemblyVersion
XmlPokeInnerText "./src/Directory.Build.props" "//Project/PropertyGroup/PackageReleaseNotes" (releaseNotes.Notes |> String.concat "\n")
)

Target "Build" (fun _ ->
Expand Down
18 changes: 9 additions & 9 deletions src/common.props → src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<Project>
<PropertyGroup>
<Copyright>Copyright © 2015-2022 Petabridge, LLC</Copyright>
<Copyright>Copyright © 2015-2023 Petabridge, LLC</Copyright>
<Authors>Petabridge</Authors>
<VersionPrefix>1.7.0</VersionPrefix>
<PackageReleaseNotes>[Bumped Akka.NET version to 1.4.40](https://github.com/akkadotnet/akka.net/releases/tag/1.4.40)
[Bumped Akka.Hosting to 0.4.1](https://github.com/akkadotnet/Akka.Hosting/releases/tag/0.4.1).
[Upgraded to Petabridge.Cmd 1.1.0](https://cmd.petabridge.com/articles/RELEASE_NOTES.html) and used Akka.Hosting support;
Added ARM64 support to Docker image `petabridge/lighthouse:latest` and all other Linux images for Lighthouse.
Migrated onto .NET 6.</PackageReleaseNotes>
<VersionPrefix>1.8.0</VersionPrefix>
<PackageReleaseNotes>[Bumped Akka.NET version to 1.5.0](https://github.com/akkadotnet/akka.net/releases/tag/1.5.0)</PackageReleaseNotes>
<PackageIconUrl>https://petabridge.com/images/logo.png</PackageIconUrl>
<PackageProjectUrl>
https://github.com/petabridge/lighthouse
Expand All @@ -16,16 +12,20 @@ Migrated onto .NET 6.</PackageReleaseNotes>
https://github.com/petabridge/lighthouse/blob/dev/LICENSE
</PackageLicenseUrl>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<LangVersion>11.0</LangVersion>
</PropertyGroup>
<PropertyGroup>
<XunitVersion>2.4.2</XunitVersion>
<MicrosoftSdkVersion>17.5.0</MicrosoftSdkVersion>
<FluentAssertionsVersion>6.8.0</FluentAssertionsVersion>
<NetCoreVersion>net6.0</NetCoreVersion>
<NetCoreVersion>net7.0</NetCoreVersion>
<NetStandardVersion>netstandard1.6</NetStandardVersion>
<NetFrameworkLibVersion>net461</NetFrameworkLibVersion>
<NetFrameworkTestVersion>net6.0</NetFrameworkTestVersion>
<AkkaVersion>1.5.1</AkkaVersion>
<PbmVersion>1.2.1</PbmVersion>
<PbmVersion>1.3.0</PbmVersion>
</PropertyGroup>
<ItemGroup>
<Using Include="Akka.Event" />
</ItemGroup>
</Project>
31 changes: 31 additions & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<!-- Akka.NET Package Versions -->
<ItemGroup>
<PackageVersion Include="Akka.Cluster.Hosting" Version="1.5.0" />
<PackageVersion Include="Akka.Logger.Serilog" Version="1.5.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Xml" Version="7.0.0" />
<PackageVersion Include="Petabridge.Cmd.Cluster" Version="$(PbmVersion)" />
<PackageVersion Include="Petabridge.Cmd.Remote" Version="$(PbmVersion)" />
<PackageVersion Include="Akka.Bootstrap.Docker" Version="0.5.3"/>
</ItemGroup>

<!-- Serilog Package Versions -->
<ItemGroup>
<PackageVersion Include="Serilog" Version="2.12.0" />
<PackageVersion Include="Serilog.Settings.Configuration" Version="3.4.0" />
<PackageVersion Include="Serilog.Sinks.Console" Version="4.1.0" />
</ItemGroup>

<!-- Test Package Versions -->
<ItemGroup>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageVersion Include="xunit" Version="2.4.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageVersion Include="FluentAssertions" Version="6.9.0" />
<PackageVersion Include="coverlet.collector" Version="3.2.0" />
<PackageVersion Include="Akka.TestKit.XUnit2" Version="$(AkkaVersion)" />
</ItemGroup>
</Project>
13 changes: 6 additions & 7 deletions src/Lighthouse.Tests/Lighthouse.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<PropertyGroup>
<TargetFramework>$(NetFrameworkTestVersion)</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Akka.TestKit.XUnit2" Version="$(AkkaVersion)" />
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftSdkVersion)" />
<PackageReference Include="xunit" Version="$(XunitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
<PackageReference Include="Akka.TestKit.XUnit2" />
<PackageReference Include="FluentAssertions"/>
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
<PackageReference Include="xunit"/>
<PackageReference Include="xunit.runner.visualstudio"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Lighthouse\Lighthouse.csproj" />
Expand Down
6 changes: 3 additions & 3 deletions src/Lighthouse/Dockerfile-arm64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS base
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS base
WORKDIR /app

# Install Petabridge.Cmd client so it can be invoked remotely via
Expand All @@ -7,9 +7,9 @@ RUN dotnet tool install --global pbm

# RUN pbm help

COPY ./bin/Release/net6.0/publish/ /app
COPY ./bin/Release/net7.0/publish/ /app

FROM mcr.microsoft.com/dotnet/runtime:6.0 AS app
FROM mcr.microsoft.com/dotnet/runtime:7.0 AS app
WORKDIR /app

COPY --from=base /app /app
Expand Down
6 changes: 3 additions & 3 deletions src/Lighthouse/Dockerfile-linux
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS base
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS base
WORKDIR /app

# Install Petabridge.Cmd client so it can be invoked remotely via
Expand All @@ -7,9 +7,9 @@ RUN dotnet tool install --global pbm

# RUN pbm help

COPY ./bin/Release/net6.0/publish/ /app
COPY ./bin/Release/net7.0/publish/ /app

FROM mcr.microsoft.com/dotnet/runtime:6.0 AS app
FROM mcr.microsoft.com/dotnet/runtime:7.0 AS app
WORKDIR /app

COPY --from=base /app /app
Expand Down
6 changes: 3 additions & 3 deletions src/Lighthouse/Dockerfile-windows
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS base
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS base
WORKDIR /app

# Install Petabridge.Cmd client so it can be invoked remotely via
Expand All @@ -10,9 +10,9 @@ WORKDIR /app

# RUN pbm help

COPY ./bin/Release/net6.0/publish/ /app
COPY ./bin/Release/net7.0/publish/ /app

FROM mcr.microsoft.com/dotnet/runtime:6.0 AS app
FROM mcr.microsoft.com/dotnet/runtime:7.0 AS app
WORKDIR /app

COPY --from=base /app /app
Expand Down
21 changes: 9 additions & 12 deletions src/Lighthouse/Lighthouse.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>$(NetCoreVersion)</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Akka.Cluster.Hosting" Version="0.5.1" />
<PackageReference Include="Akka.Logger.Serilog" Version="1.4.42" />
<PackageReference Include="Microsoft.Extensions.Configuration.Xml" Version="7.0.0" />
<PackageReference Include="Petabridge.Cmd.Cluster" Version="$(PbmVersion)" />
<PackageReference Include="Petabridge.Cmd.Remote" Version="$(PbmVersion)" />
<PackageReference Include="Akka.Bootstrap.Docker">
<Version>0.5.3</Version>
</PackageReference>
<PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Akka.Cluster.Hosting"/>
<PackageReference Include="Akka.Logger.Serilog"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Xml"/>
<PackageReference Include="Petabridge.Cmd.Cluster"/>
<PackageReference Include="Petabridge.Cmd.Remote"/>
<PackageReference Include="Akka.Bootstrap.Docker"/>
<PackageReference Include="Serilog"/>
<PackageReference Include="Serilog.Settings.Configuration"/>
<PackageReference Include="Serilog.Sinks.Console"/>
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Lighthouse/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static async Task Main(string[] args)
{
services.AddAkka(actorSystemName, builder =>
{
builder.AddHocon(config) // clustering / remoting automatically configured here
builder.AddHocon(config, HoconAddMode.Prepend) // clustering / remoting automatically configured here
.AddPetabridgeCmd(cmd =>
{
cmd.RegisterCommandPalette(ClusterCommands.Instance);
Expand Down
2 changes: 1 addition & 1 deletion src/Lighthouse/buildLinuxDockerImages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi


echo "Building project..."
dotnet publish -c Release --framework net6.0
dotnet publish -c Release --framework net7.0
dotnet build-server shutdown

LINUX_IMAGE="$IMAGE_NAME:linux-$IMAGE_VERSION"
Expand Down
2 changes: 1 addition & 1 deletion src/Lighthouse/buildWindowsDockerImages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ param (
)

Write-Host "Building project..."
dotnet publish -c Release --framework net6.0
dotnet publish -c Release --framework net7.0
dotnet build-server shutdown

$windowsImage = "{0}:windows-{1}" -f $imageName,$tagVersion
Expand Down

0 comments on commit e9907ce

Please sign in to comment.