upgrading to .net 9, adding arm images

This commit is contained in:
Andy Pack 2025-03-15 14:33:27 +00:00
parent 197d65220a
commit ed9fc3a8a0
Signed by: sarsoo
GPG Key ID: A55BA3536A5E0ED7
9 changed files with 69 additions and 66 deletions
.gitea/workflows
.github/workflows
Dockerfile
Overflow.CLI
Overflow.Test
Overflow.Web.Client
Overflow.Web
Overflow

@ -9,7 +9,7 @@ jobs:
name: Build & Unit Test
strategy:
matrix:
dotnet-version: [ '8.0.x' ]
dotnet-version: [ '9.0.x' ]
arch: ['ubuntu-latest', 'ubuntu-latest-arm']
steps:

@ -5,12 +5,12 @@ on: [push]
jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.arch }}
name: Build & Unit Test
strategy:
fail-fast: false
matrix:
dotnet-version: [ '8.0.x' ]
dotnet-version: [ '9.0.x' ]
arch: ['ubuntu-latest', 'ubuntu-24.04-arm']
steps:
- uses: actions/checkout@v2
@ -29,8 +29,11 @@ jobs:
build-Docker:
runs-on: ubuntu-latest
runs-on: ${{ matrix.arch }}
name: Build Containers
strategy:
matrix:
arch: ['ubuntu-latest', 'ubuntu-24.04-arm']
needs: [build] # for ignoring bad builds
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
@ -55,25 +58,25 @@ jobs:
sarsoo/overflow:${{ github.ref_name }}
file: Dockerfile
deploy:
# deploy:
runs-on: ubuntu-latest
name: Deploy
needs: [build-Docker] # for ignoring bad builds
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
environment:
name: prod
url: https://overflow.sarsoo.xyz
steps:
- uses: actions/checkout@v3
# runs-on: ubuntu-latest
# name: Deploy
# needs: [build-Docker] # for ignoring bad builds
# if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
# environment:
# name: prod
# url: https://overflow.sarsoo.xyz
# steps:
# - uses: actions/checkout@v3
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
version: 1.68.1
# - name: Tailscale
# uses: tailscale/github-action@v2
# with:
# oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
# oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
# tags: tag:ci
# version: 1.68.1
- name: Deploy
run: ssh -o StrictHostKeyChecking=no ${{ secrets.TS_SSH }} -t "cd overflow/ && docker compose up -d --pull always"
# - name: Deploy
# run: ssh -o StrictHostKeyChecking=no ${{ secrets.TS_SSH }} -t "cd overflow/ && docker compose up -d --pull always"

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS base
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS base
RUN dotnet workload install wasm-tools
RUN apt update && apt install -y python3
@ -6,7 +6,7 @@ RUN apt update && apt install -y python3
COPY *.sln .
COPY Overflow/*.csproj ./Overflow/
COPY Overflow.Web/*.csproj ./Overflow.Web/
COPY Overflow.Web.Client/*.csproj ./Overflow.Web.Clientl/
COPY Overflow.Web.Client/*.csproj ./Overflow.Web.Client/
RUN dotnet restore ./Overflow.Web/Overflow.Web.csproj
COPY . ./
@ -14,7 +14,7 @@ COPY . ./
FROM base as publish
RUN dotnet publish Overflow.Web/Overflow.Web.csproj -c Release -o /app
FROM mcr.microsoft.com/dotnet/aspnet:8.0
FROM mcr.microsoft.com/dotnet/aspnet:9.0
EXPOSE 80
WORKDIR /app
COPY --from=publish /app ./

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
@ -12,7 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.29.0" />
<PackageReference Include="MongoDB.Driver" Version="3.2.1" />
</ItemGroup>
</Project>

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
@ -10,14 +10,14 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.3.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RunAOTCompilation>true</RunAOTCompilation>
@ -9,9 +9,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.8" PrivateAssets="all" />
<PackageReference Include="Radzen.Blazor" Version="5.2.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.3" PrivateAssets="all" />
<PackageReference Include="Radzen.Blazor" Version="6.2.7" />
</ItemGroup>
<ItemGroup>

@ -1,22 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.8" />
<PackageReference Include="MongoDB.Driver" Version="2.29.0" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.14" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.14" />
<PackageReference Include="Quartz" Version="3.13.0" />
<PackageReference Include="Quartz.AspNetCore" Version="3.13.0" />
<PackageReference Include="Quartz.Extensions.DependencyInjection" Version="3.13.0" />
<PackageReference Include="Quartz.Extensions.Hosting" Version="3.13.0" />
<PackageReference Include="Radzen.Blazor" Version="5.2.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.3" />
<PackageReference Include="MongoDB.Driver" Version="3.2.1" />
<PackageReference Include="NLog" Version="5.4.0" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.4.0" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.4.0" />
<PackageReference Include="Quartz" Version="3.14.0" />
<PackageReference Include="Quartz.AspNetCore" Version="3.14.0" />
<PackageReference Include="Quartz.Extensions.DependencyInjection" Version="3.14.0" />
<PackageReference Include="Quartz.Extensions.Hosting" Version="3.14.0" />
<PackageReference Include="Radzen.Blazor" Version="6.2.7" />
</ItemGroup>
<ItemGroup>

@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageReference Include="MongoDB.Driver" Version="2.29.0" />
<PackageReference Include="Quartz" Version="3.13.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.3" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.3" />
<PackageReference Include="MongoDB.Driver" Version="3.2.1" />
<PackageReference Include="Quartz" Version="3.14.0" />
</ItemGroup>
<ItemGroup>

@ -13,7 +13,7 @@ public partial class SouthernWaterApi
private static readonly string spillsEndpoint = "Spills/GetHistoricSpills";
private string baseUrl;
private string baseUrl = "https://dv.southernwater.co.uk/gateway/Beachbuoy/1.0/api/v1.0/";
private string apiKey;
public SouthernWaterApi(HttpClient client, ILogger<SouthernWaterApi> logger)
@ -22,7 +22,7 @@ public partial class SouthernWaterApi
_logger = logger;
}
[GeneratedRegex(@".APIURL=""(?<APIURL>.*)"".*APIGWKEY=""(?<APIKEY>.*?)"".*", RegexOptions.IgnoreCase)]
[GeneratedRegex(@"const APIGWKEY = '(?<APIKEY>.*?)'.*", RegexOptions.IgnoreCase)]
private static partial Regex ApiUrlAndKey();
public async Task LoadApiUrl()
@ -61,14 +61,14 @@ public partial class SouthernWaterApi
Match m = ApiUrlAndKey().Match(contentString);
var apiUrlFound = m.Groups.TryGetValue("APIURL", out var apiUrl);
// var apiUrlFound = m.Groups.TryGetValue("APIURL", out var apiUrl);
var apiKeyFound = m.Groups.TryGetValue("APIKEY", out var apiKey);
if (apiUrlFound)
{
baseUrl = apiUrl.Value;
_logger.LogInformation("API url found [{APIUrl}]", apiUrl);
}
// if (apiUrlFound)
// {
// baseUrl = apiUrl.Value;
// _logger.LogInformation("API url found [{APIUrl}]", apiUrl);
// }
if (apiKeyFound)
{