mirror of
https://github.com/ivuorinen/hiha-arvio.git
synced 2026-03-17 11:02:09 +00:00
feat: upgrade to .NET 10 / MAUI 10.x (#6)
This commit is contained in:
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
|
||||
with:
|
||||
dotnet-version: '9.0.x'
|
||||
dotnet-version: '10.0.x'
|
||||
|
||||
- name: Select Xcode version
|
||||
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
|
||||
@@ -33,15 +33,15 @@ jobs:
|
||||
run: dotnet workload restore src/HihaArvio/HihaArvio.csproj
|
||||
|
||||
- name: Build iOS
|
||||
run: dotnet build src/HihaArvio/HihaArvio.csproj -f net9.0-ios -c Release /p:ArchiveOnBuild=false /p:EnableCodeSigning=false
|
||||
run: dotnet build src/HihaArvio/HihaArvio.csproj -f net10.0-ios -c Release /p:ArchiveOnBuild=false /p:EnableCodeSigning=false
|
||||
|
||||
- name: Upload iOS build artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: ios-build
|
||||
path: |
|
||||
src/HihaArvio/bin/Release/net9.0-ios/**/*.app
|
||||
src/HihaArvio/bin/Release/net9.0-ios/**/*.ipa
|
||||
src/HihaArvio/bin/Release/net10.0-ios/**/*.app
|
||||
src/HihaArvio/bin/Release/net10.0-ios/**/*.ipa
|
||||
retention-days: 7
|
||||
|
||||
build-maccatalyst:
|
||||
@@ -58,7 +58,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
|
||||
with:
|
||||
dotnet-version: '9.0.x'
|
||||
dotnet-version: '10.0.x'
|
||||
|
||||
- name: Select Xcode version
|
||||
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
|
||||
@@ -69,15 +69,15 @@ jobs:
|
||||
run: dotnet workload restore src/HihaArvio/HihaArvio.csproj
|
||||
|
||||
- name: Build macOS Catalyst
|
||||
run: dotnet build src/HihaArvio/HihaArvio.csproj -f net9.0-maccatalyst -c Release /p:ArchiveOnBuild=false /p:EnableCodeSigning=false
|
||||
run: dotnet build src/HihaArvio/HihaArvio.csproj -f net10.0-maccatalyst -c Release /p:ArchiveOnBuild=false /p:EnableCodeSigning=false
|
||||
|
||||
- name: Upload macOS build artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: maccatalyst-build
|
||||
path: |
|
||||
src/HihaArvio/bin/Release/net9.0-maccatalyst/**/*.app
|
||||
src/HihaArvio/bin/Release/net9.0-maccatalyst/**/*.pkg
|
||||
src/HihaArvio/bin/Release/net10.0-maccatalyst/**/*.app
|
||||
src/HihaArvio/bin/Release/net10.0-maccatalyst/**/*.pkg
|
||||
retention-days: 7
|
||||
|
||||
build-status:
|
||||
|
||||
10
.github/workflows/publish.yml
vendored
10
.github/workflows/publish.yml
vendored
@@ -12,7 +12,7 @@ on:
|
||||
type: string
|
||||
|
||||
env:
|
||||
DOTNET_VERSION: '9.0.x'
|
||||
DOTNET_VERSION: '10.0.x'
|
||||
|
||||
jobs:
|
||||
build-ios:
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
- name: Build iOS Release
|
||||
run: |
|
||||
dotnet publish src/HihaArvio/HihaArvio.csproj \
|
||||
-f net9.0-ios \
|
||||
-f net10.0-ios \
|
||||
-c Release \
|
||||
/p:ApplicationDisplayVersion=${{ steps.get_version.outputs.version }} \
|
||||
/p:ApplicationVersion=${{ github.run_number }} \
|
||||
@@ -60,7 +60,7 @@ jobs:
|
||||
|
||||
- name: Create iOS artifact archive
|
||||
run: |
|
||||
cd src/HihaArvio/bin/Release/net9.0-ios
|
||||
cd src/HihaArvio/bin/Release/net10.0-ios
|
||||
# Find the .app bundle (it's in a subdirectory like iossimulator-arm64 or ios-arm64)
|
||||
APP_PATH=$(find . -name "*.app" -type d | head -n 1)
|
||||
if [ -z "$APP_PATH" ]; then
|
||||
@@ -113,7 +113,7 @@ jobs:
|
||||
- name: Build macOS Catalyst Release
|
||||
run: |
|
||||
dotnet publish src/HihaArvio/HihaArvio.csproj \
|
||||
-f net9.0-maccatalyst \
|
||||
-f net10.0-maccatalyst \
|
||||
-c Release \
|
||||
/p:ApplicationDisplayVersion=${{ steps.get_version.outputs.version }} \
|
||||
/p:ApplicationVersion=${{ github.run_number }} \
|
||||
@@ -122,7 +122,7 @@ jobs:
|
||||
|
||||
- name: Create macOS artifact archive
|
||||
run: |
|
||||
cd src/HihaArvio/bin/Release/net9.0-maccatalyst
|
||||
cd src/HihaArvio/bin/Release/net10.0-maccatalyst
|
||||
# Find the .app bundle (it's in a subdirectory like maccatalyst-x64 or maccatalyst-arm64)
|
||||
APP_PATH=$(find . -name "*.app" -type d | head -n 1)
|
||||
if [ -z "$APP_PATH" ]; then
|
||||
|
||||
12
.github/workflows/test.yml
vendored
12
.github/workflows/test.yml
vendored
@@ -22,16 +22,16 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
|
||||
with:
|
||||
dotnet-version: '9.0.x'
|
||||
dotnet-version: '10.0.x'
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore tests/HihaArvio.Tests/HihaArvio.Tests.csproj /p:TargetFrameworks=net9.0
|
||||
run: dotnet restore tests/HihaArvio.Tests/HihaArvio.Tests.csproj /p:TargetFrameworks=net10.0
|
||||
|
||||
- name: Build test project
|
||||
run: dotnet build tests/HihaArvio.Tests/HihaArvio.Tests.csproj --configuration Release --no-restore /p:TargetFrameworks=net9.0
|
||||
run: dotnet build tests/HihaArvio.Tests/HihaArvio.Tests.csproj --configuration Release --no-restore /p:TargetFrameworks=net10.0
|
||||
|
||||
- name: Run tests with coverage
|
||||
run: dotnet test tests/HihaArvio.Tests/HihaArvio.Tests.csproj --configuration Release --no-build --verbosity normal /p:TargetFrameworks=net9.0 --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx"
|
||||
run: dotnet test tests/HihaArvio.Tests/HihaArvio.Tests.csproj --configuration Release --no-build --verbosity normal /p:TargetFrameworks=net10.0 --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx"
|
||||
|
||||
- name: Install ReportGenerator
|
||||
run: dotnet tool install --global dotnet-reportgenerator-globaltool
|
||||
@@ -43,10 +43,10 @@ jobs:
|
||||
run: |
|
||||
# Extract and display line coverage percentage
|
||||
COVERAGE=$(grep -oP 'Line coverage: \K[\d.]+' coverage/Summary.txt | head -1)
|
||||
echo "📊 Code coverage for net9.0 target: ${COVERAGE}%"
|
||||
echo "📊 Code coverage for net10.0 target: ${COVERAGE}%"
|
||||
echo ""
|
||||
echo "Note: Multi-target MAUI projects cannot achieve full coverage on Linux runners."
|
||||
echo "Platform-specific code (iOS/macOS) is excluded when building net9.0 only."
|
||||
echo "Platform-specific code (iOS/macOS) is excluded when building net10.0 only."
|
||||
echo "Full coverage measurement requires macOS runners with all target frameworks."
|
||||
|
||||
- name: Upload coverage report
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Per spec: iOS (primary), Web (Blazor), macOS (tertiary) -->
|
||||
<!-- net9.0 included for unit testing without platform dependencies -->
|
||||
<!-- net10.0 included for unit testing without platform dependencies -->
|
||||
<!-- Include iOS/macOS targets only on macOS (where they can be built) -->
|
||||
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">net9.0;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
|
||||
<!-- On Linux/Windows, only include net9.0 -->
|
||||
<TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('OSX'))">net9.0</TargetFrameworks>
|
||||
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">net10.0;net10.0-ios;net10.0-maccatalyst</TargetFrameworks>
|
||||
<!-- On Linux/Windows, only include net10.0 -->
|
||||
<TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('OSX'))">net10.0</TargetFrameworks>
|
||||
|
||||
<!-- Note for MacCatalyst:
|
||||
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
|
||||
@@ -15,10 +15,10 @@
|
||||
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
|
||||
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
|
||||
|
||||
<OutputType Condition="'$(TargetFramework)' != 'net9.0'">Exe</OutputType>
|
||||
<OutputType Condition="'$(TargetFramework)' == 'net9.0'">Library</OutputType>
|
||||
<OutputType Condition="'$(TargetFramework)' != 'net10.0'">Exe</OutputType>
|
||||
<OutputType Condition="'$(TargetFramework)' == 'net10.0'">Library</OutputType>
|
||||
<RootNamespace>HihaArvio</RootNamespace>
|
||||
<UseMaui Condition="'$(TargetFramework)' != 'net9.0'">true</UseMaui>
|
||||
<UseMaui Condition="'$(TargetFramework)' != 'net10.0'">true</UseMaui>
|
||||
<SingleProject>true</SingleProject>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
@@ -61,11 +61,11 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Per spec: MAUI 9.x with explicit lower bound -->
|
||||
<!-- Per spec: MAUI 10.x -->
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.120" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.120" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.14" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls" Version="10.0.50" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="10.0.50" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.5" />
|
||||
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
|
||||
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.11" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user