Skip to content

Commit

Permalink
CI,scripts,snap,Frontend.Maui: use .NET 8
Browse files Browse the repository at this point in the history
Switch to using .NET 8. Use Maui 8 on Gtk. The main reason
for upgrade is that crash when using navigation bar was fixed
in Maui 8. Also .NET 6 is nearing end of suport anyway.

Update Microsoft.Extensions.DependencyInjection to v 8.0.0.
This iss needed to avoid error:
```
error NU1605: Warning As Error: Detected package downgrade:
Microsoft.Extensions.DependencyInjection from 8.0.0 to 6.0.0. Reference
the package directly from the project to select a different version.
```

Install maui workloads on windows--dotnet8-* lanes so that
Maui/Android can be built.

Call fsxc with DOTNET_ROLL_FORWARD=Major to allow it to run
under newer .NET version (we use .NET8 now, and fsxc is
compiled for .NET6).
  • Loading branch information
webwarrior-ws committed Jul 2, 2024
1 parent 1b47dda commit 0e8ef0a
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 42 deletions.
60 changes: 39 additions & 21 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
- cron: "0 0 * * *"

env:
GtkSharpVersion: 3.24.24.95
DotNetVersionForMauiGtk: 6.0.400
GtkSharpVersion: 3.24.24.117-develop
DotNetVersionForMauiGtk: 8.0.200

# FIXME: figure out why we need to clean after make if we
# want 'make strict' target to really happen without
Expand Down Expand Up @@ -94,12 +94,16 @@ jobs:
- name: integration tests
run: make update-servers

macOS--dotnet6-only:
macOS--dotnet8-only:
runs-on: macOS-12
steps:
- uses: actions/checkout@v1
with:
submodules: false
- name: Setup .NET SDK 8.0.x
uses: actions/setup-dotnet@v1.7.2
with:
dotnet-version: '8.0.300'
- name: HACK to emulate mono uninstall
run: sudo rm -f `which mono` && sudo rm -f `which msbuild`
- name: configure
Expand All @@ -117,16 +121,18 @@ jobs:
- name: integration tests
run: make update-servers

windows--dotnet6-and-legacyFramework:
windows--dotnet8-and-legacyFramework:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
with:
submodules: false
- name: Setup .NET SDK 6.0.x
- name: Setup .NET SDK 8.0.x
uses: actions/setup-dotnet@v1.7.2
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'
- name: install maui workloads
run: dotnet workload install maui
- name: configure
run: .\configure.bat
- name: build in DEBUG mode
Expand All @@ -148,6 +154,8 @@ jobs:
# we need to install specific version because of this bug: https://github.com/dotnet/sdk/issues/24037
dotnet tool install fsxc --version 0.5.9.1
# make it work with newer .NET
export DOTNET_ROLL_FORWARD=Major
find . -type f -name "*.fsx" | xargs -t -I {} dotnet fsxc {}
Expand All @@ -174,18 +182,20 @@ jobs:
- name: integration tests
run: .\make update-servers

windows--dotnet6-only:
windows--dotnet8-only:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
with:
submodules: false
- name: Setup .NET SDK 6.0.x
- name: Setup .NET SDK 8.0.x
uses: actions/setup-dotnet@v1.7.2
with:
dotnet-version: '6.0.113'
dotnet-version: '8.0.x'
- name: HACK to emulate legacy .NETFramework uninstall
run: del $(& "${Env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -find MSBuild\\**\\Bin\\MSBuild.exe)
- name: install maui workloads
run: dotnet workload install maui
- name: configure
run: .\configure.bat
- name: build in DEBUG mode
Expand All @@ -207,6 +217,8 @@ jobs:
# we need to install specific version because of this bug: https://github.com/dotnet/sdk/issues/24037
dotnet tool install fsxc --version 0.5.9.1
# make it work with newer .NET
export DOTNET_ROLL_FORWARD=Major
find . -type f -name "*.fsx" | xargs -t -I {} dotnet fsxc {}
Expand Down Expand Up @@ -311,7 +323,7 @@ jobs:
- name: integration tests
run: make update-servers

linux-vanilla--stockdotnet6-only:
linux-vanilla--stockdotnet8-only:
runs-on: ubuntu-22.04
container:
image: "ubuntu:22.04"
Expand All @@ -324,7 +336,7 @@ jobs:
- name: install sudo
run: apt update && apt install --yes sudo
- name: install all dependencies
run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make dotnet6
run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make dotnet8

# workaround for https://github.com/actions/runner/issues/2033
- name: ownership workaround
Expand All @@ -350,10 +362,12 @@ jobs:
# we need to install specific version because of this bug: https://github.com/dotnet/sdk/issues/24037
dotnet tool install fsxc --version 0.5.9.1
# make it work with newer .NET
export DOTNET_ROLL_FORWARD=Major
find . -type f -name "*.fsx" | xargs -t -I {} dotnet fsxc {}
linux-vanilla--stockdotnet6-and-newmono:
linux-vanilla--stockdotnet8-and-newmono:
runs-on: ubuntu-22.04
container:
image: "ubuntu:22.04"
Expand All @@ -366,7 +380,7 @@ jobs:
- name: install sudo
run: apt update && apt install --yes sudo
- name: install all dependencies
run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make dotnet6
run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make dotnet8
- name: install last version of mono (Microsoft APT repositories)
run: sudo ./scripts/install_mono_from_microsoft_deb_packages.sh

Expand Down Expand Up @@ -394,10 +408,12 @@ jobs:
# we need to install specific version because of this bug: https://github.com/dotnet/sdk/issues/24037
dotnet tool install fsxc --version 0.5.9.1
# make it work with newer .NET
export DOTNET_ROLL_FORWARD=Major
find . -type f -name "*.fsx" | xargs -t -I {} dotnet fsxc {}
linux-vanilla--stockdotnet6-and-stockmono:
linux-vanilla--stockdotnet8-and-stockmono:
runs-on: ubuntu-22.04
container:
image: "ubuntu:22.04"
Expand All @@ -410,7 +426,7 @@ jobs:
- name: install sudo
run: apt update && apt install --yes sudo
- name: install all dependencies
run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make dotnet6 mono-xbuild fsharp
run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make dotnet8 mono-xbuild fsharp
- name: install GTK libs (dependency of GTK frontend)
run: sudo apt install --yes libgtk2.0-cil-dev
# workaround for https://github.com/actions/runner/issues/2033
Expand All @@ -437,6 +453,8 @@ jobs:
# we need to install specific version because of this bug: https://github.com/dotnet/sdk/issues/24037
dotnet tool install fsxc --version 0.5.9.1
# make it work with newer .NET
export DOTNET_ROLL_FORWARD=Major
find . -type f -name "*.fsx" | xargs -t -I {} dotnet fsxc {}
Expand Down Expand Up @@ -490,15 +508,15 @@ jobs:
- linux-github--dotnet-and-newmono
- linux-vanilla--stockmono-only
- linux-vanilla--newmono-only
- linux-vanilla--stockdotnet6-only
- linux-vanilla--stockdotnet6-and-stockmono
- linux-vanilla--stockdotnet6-and-newmono
- windows--dotnet6-and-legacyFramework
- linux-vanilla--stockdotnet8-only
- linux-vanilla--stockdotnet8-and-stockmono
- linux-vanilla--stockdotnet8-and-newmono
- windows--dotnet8-and-legacyFramework
- windows--legacyFramework-only
- windows--dotnet6-only
- windows--dotnet8-only
- macOS--dotnet8-and-mono
- macOS--mono-only
- macOS--dotnet6-only
- macOS--dotnet8-only

steps:
- uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion dependencies/maui
Submodule maui updated 8422 files
6 changes: 0 additions & 6 deletions global-net6.json

This file was deleted.

7 changes: 1 addition & 6 deletions scripts/configure.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,7 @@ let version = Misc.GetCurrentVersion(rootDir)
let repoInfo = Git.GetRepoInfo()

if not (List.isEmpty mauiWorkloads) then
let globalJsonFile =
if frontend = "Maui/Gtk" then
"global-net6.json"
else
"global-net8.json"

let globalJsonFile = "global-net8.json"
File.Copy(globalJsonFile, "global.json")

Console.WriteLine()
Expand Down
4 changes: 2 additions & 2 deletions scripts/make.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ let JustBuild binaryConfig maybeConstant: FrontendApp*FileInfo =
| _ -> FrontendApp.Console
| Some "dotnet", _ when maybeConfigFrontend |> Option.exists (fun value -> value.StartsWith "Maui") ->
if maybeConfigFrontend = Some "Maui/Gtk" then
BuildMauiProject binaryConfig "net6.0-gtk"
BuildMauiProject binaryConfig "net8.0-gtk"
else
BuildMauiProject binaryConfig "net8.0-android"

Expand Down Expand Up @@ -457,7 +457,7 @@ let GetPathToFrontend (frontend: FrontendApp) (binaryConfig: BinaryConfig): Dire
"bin",
binaryConfig.ToString()
#if !LEGACY_FRAMEWORK
, "net6.0"
, "net8.0"
#endif
) |> DirectoryInfo

Expand Down
4 changes: 2 additions & 2 deletions scripts/snap_build_maui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ set -euxo pipefail
# Build GWallet MAUI Gtk project
./configure.sh
make
dotnet build --configuration=Release --framework=net6.0-gtk ./src/GWallet.Frontend.Maui/GWallet.Frontend.Maui.fsproj
dotnet publish --configuration=Release --framework=net6.0-gtk --output=./staging ./src/GWallet.Frontend.Maui/GWallet.Frontend.Maui.fsproj
dotnet build --configuration=Release --framework=net8.0-gtk ./src/GWallet.Frontend.Maui/GWallet.Frontend.Maui.fsproj
dotnet publish --configuration=Release --framework=net8.0-gtk --output=./staging ./src/GWallet.Frontend.Maui/GWallet.Frontend.Maui.fsproj
cp ./scripts/geewallet-maui-gtk.sh ./staging/

rm ./snap/snapcraft.yaml
Expand Down
2 changes: 1 addition & 1 deletion snap/local/snapcraft_maui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ parts:
organize:
geewallet-maui-gtk.sh: bin/geewallet-maui-gtk.sh
stage-packages:
- dotnet-runtime-7.0
- dotnet-runtime-8.0
override-build: |
set -ex
Expand Down
2 changes: 1 addition & 1 deletion src/GWallet.Backend.Tests/GWallet.Backend.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<GenerateProgramFile>false</GenerateProgramFile>
<MSBuildTreatWarningsAsErrors>false</MSBuildTreatWarningsAsErrors>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\GWallet.Backend\Properties\CommonAssemblyInfo.fs">
Expand Down
3 changes: 2 additions & 1 deletion src/GWallet.Frontend.Maui/GWallet.Frontend.Maui.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- NOTE: when making changes to the lines below, maybe remove CheckEolWorkloads tag too -->
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('linux'))">net6.0-gtk</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('linux'))">net8.0-gtk</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->

Expand Down Expand Up @@ -215,6 +215,7 @@
<ItemGroup>
<PackageReference Include="FSharp.Core" Version="6.0.3" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.21" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="$(TargetPlatformIdentifier) != 'gtk'">
Expand Down

0 comments on commit 0e8ef0a

Please sign in to comment.