Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.net 8.0 #118

Merged
merged 7 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,42 @@ jobs:
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8

- name: Setup .NET 7
- name: Setup .NET 8
uses: actions/setup-dotnet@4d4a70f4a5b2a5a5329f13be4ac933f2c9206ac0
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Install MAUI Workload
run: dotnet workload install maui --ignore-failed-sources --from-rollback-file https://maui.blob.core.windows.net/metadata/rollbacks/7.0.2xx.json
run: dotnet workload install maui --ignore-failed-sources

- name: Restore Dependencies
run: dotnet restore IfpaMaui.csproj

- name: Build MAUI Android
run: dotnet build IfpaMaui.csproj -c Debug -f net7.0-android33.0 --no-restore
run: dotnet build IfpaMaui.csproj -c Debug -f net8.0-android --no-restore

# MAUI iOS Build
build-ios:
runs-on: macos-12
runs-on: macos-13
name: iOS Build
environment: Release
steps:

- name: Use Xcode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.2'
xcode-version: '15.0'

- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8

- name: Setup .NET 7
- name: Setup .NET 8
uses: actions/setup-dotnet@4d4a70f4a5b2a5a5329f13be4ac933f2c9206ac0
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Install MAUI Workload
run: dotnet workload install maui --ignore-failed-sources --from-rollback-file https://maui.blob.core.windows.net/metadata/rollbacks/7.0.2xx.json
run: dotnet workload install maui --ignore-failed-sources

- name: Restore Dependencies
run: dotnet restore IfpaMaui.csproj
Expand Down Expand Up @@ -98,4 +98,4 @@ jobs:
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles

- name: Build MAUI iOS
run: dotnet build IfpaMaui.csproj -c Release -f net7.0-ios -p:ArchiveOnBuild=true
run: dotnet build IfpaMaui.csproj -c Release -f net8.0-ios -p:ArchiveOnBuild=true
23 changes: 14 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
description: 'version number'
required: true
default: '0.1.1'

env:
DOTNET_NOLOGO: true # Disable the .NET logo
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry

jobs:
publish-android:
Expand Down Expand Up @@ -66,10 +71,10 @@ jobs:
echo "${{ secrets.IFPA_ANDROID_KEYSTORE }}" > ifpamaui.keystore.asc
certutil -decode ifpamaui.keystore.asc ifpa-keystore.jks

- name: Setup .NET 7
- name: Setup .NET 8
uses: actions/setup-dotnet@4d4a70f4a5b2a5a5329f13be4ac933f2c9206ac0
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Install MAUI Workload
run: dotnet workload install maui android
Expand All @@ -78,21 +83,21 @@ jobs:
run: dotnet restore IfpaMaui.csproj

- name: Build MAUI Android
run: dotnet publish IfpaMaui.csproj -c Release -f net7.0-android33.0 -p:Version=$Env:VERSION -p:ApplicationDisplayVersion=$Env:VERSION -p:ApplicationVersion=${{ env.VERSION_NUMBER_WITH_OFFSET }} --no-restore -p:AndroidKeyStore=True /p:AndroidSigningKeyStore=ifpa-keystore.jks /p:AndroidSigningKeyAlias=upload /p:AndroidSigningKeyPass="${{ secrets.IFPA_ANDROID_KEYSTORE_PASSWORD }}" /p:AndroidSigningStorePass="${{ secrets.IFPA_ANDROID_KEYSTORE_PASSWORD }}" --no-restore
run: dotnet publish IfpaMaui.csproj -c Release -f net8.0-android -p:Version=$Env:VERSION -p:ApplicationDisplayVersion=$Env:VERSION -p:ApplicationVersion=${{ env.VERSION_NUMBER_WITH_OFFSET }} --no-restore -p:AndroidKeyStore=True /p:AndroidSigningKeyStore=ifpa-keystore.jks /p:AndroidSigningKeyAlias=upload /p:AndroidSigningKeyPass="${{ secrets.IFPA_ANDROID_KEYSTORE_PASSWORD }}" /p:AndroidSigningStorePass="${{ secrets.IFPA_ANDROID_KEYSTORE_PASSWORD }}" --no-restore

- name: Upload Android Artifact
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8
with:
if-no-files-found: error
name: ifpamaui-android-signed-build
path: bin/Release/net7.0-android33.0/publish/com.edgiardina.ifpa-Signed.aab
path: bin/Release/net8.0-android/publish/com.edgiardina.ifpa-Signed.aab

- name: Deploy to Google Play (Production)
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.edgiardina.ifpa
releaseFiles: bin/Release/net7.0-android33.0/publish/com.edgiardina.ifpa-Signed.aab
releaseFiles: bin/Release/net8.0-android/publish/com.edgiardina.ifpa-Signed.aab
releaseName: ${{ env.VERSION }}
track: production

Expand Down Expand Up @@ -178,7 +183,7 @@ jobs:
shell: bash
run: |
dotnet nuget locals all --clear
dotnet workload install ios maui --source https://api.nuget.org/v3/index.json --from-rollback-file https://maui.blob.core.windows.net/metadata/rollbacks/7.0.2xx.json
dotnet workload install ios maui --source https://api.nuget.org/v3/index.json

- name: Restore nuget packages
run: dotnet restore IfpaMaui.sln
Expand All @@ -187,18 +192,18 @@ jobs:
- name : Publish iOS App
shell: bash
run: |
dotnet publish -f net7.0-ios -c Release -p:ArchiveOnBuild=true -p:Version=${VERSION} -p:ApplicationDisplayVersion=${VERSION} -p:ApplicationVersion=${{ env.VERSION_NUMBER_WITH_OFFSET }}
dotnet publish -f net8.0-ios -c Release -p:ArchiveOnBuild=true -p:Version=${VERSION} -p:ApplicationDisplayVersion=${VERSION} -p:ApplicationVersion=${{ env.VERSION_NUMBER_WITH_OFFSET }}

- uses: actions/upload-artifact@v2
with:
name: ifpamaui-ios-signed-build
if-no-files-found: error
path: |
bin/Release/net7.0-ios/**/*.ipa
bin/Release/net8.0-ios/**/*.ipa

- name: Upload app to App Store Connect
env:
APP_STORE_CONNECT_USERNAME: ${{ secrets.APP_STORE_CONNECT_USERNAME }}
APP_STORE_CONNECT_PASSWORD: ${{ secrets.APP_STORE_CONNECT_PASSWORD }}
run: |
xcrun altool --upload-app -t ios -f "bin/Release/net7.0-ios/ios-arm64/publish/IfpaMaui.ipa" -u "$APP_STORE_CONNECT_USERNAME" -p "$APP_STORE_CONNECT_PASSWORD"
xcrun altool --upload-app -t ios -f "bin/Release/net8.0-ios/ios-arm64/publish/IfpaMaui.ipa" -u "$APP_STORE_CONNECT_USERNAME" -p "$APP_STORE_CONNECT_PASSWORD"
12 changes: 4 additions & 8 deletions BackgroundJobs/NotificationJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@ public NotificationJob(NotificationService notificationService)

public async Task Run(JobInfo jobInfo, CancellationToken cancelToken)
{
if (jobInfo.PeriodicTime != null)
{
await notificationService.NotifyIfUsersRankChanged();
await notificationService.NotifyIfUserHasNewlySubmittedTourneyResults();
await notificationService.NotifyIfNewBlogItemPosted();
await notificationService.NotifyIfNewCalendarEntry();
}

await notificationService.NotifyIfUsersRankChanged();
await notificationService.NotifyIfUserHasNewlySubmittedTourneyResults();
await notificationService.NotifyIfNewBlogItemPosted();
await notificationService.NotifyIfNewCalendarEntry();
}
}
}
68 changes: 33 additions & 35 deletions IfpaMaui.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0-ios;net7.0-maccatalyst;net7.0-android33.0</TargetFrameworks>
<TargetFrameworks>net8.0-ios;net8.0-maccatalyst;net8.0-android</TargetFrameworks>
<!--<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</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 @@ -29,35 +29,38 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>-->
<UserSecretsId>dde96872-83d8-431f-9f14-fdd8d175bcd6</UserSecretsId>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net7.0-ios' and '$(Configuration)' == 'Release'">
<PropertyGroup Condition="'$(TargetFramework)'=='net8.0-ios' and '$(Configuration)' == 'Release'">
<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
<CodesignKey>iPhone Distribution: Ed Giardina (KH5JKUPW2Q)</CodesignKey>
<CodesignProvision>IFPA Companion Distribution Provisioning Profile</CodesignProvision>
<ArchiveOnBuild>true</ArchiveOnBuild>
<MtouchLink>None</MtouchLink>
<UseInterpreter>true</UseInterpreter>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net7.0-ios' and '$(Configuration)' == 'Debug'">
<PropertyGroup Condition="'$(TargetFramework)'=='net8.0-ios' and '$(Configuration)' == 'Debug'">
<CodesignKey>Apple Development: Created via API (2QBM4V4L2D)</CodesignKey>
<CodesignProvision>VS: com.edgiardina.ifpa Development</CodesignProvision>
</PropertyGroup>

<PropertyGroup>
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup>
<ShinyVersion>3.0.0-alpha-0496</ShinyVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
<MtouchLink>None</MtouchLink>
<MtouchLink>None</MtouchLink>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0-ios|AnyCPU'">
<MtouchLink>SdkOnly</MtouchLink>
<MtouchLink>SdkOnly</MtouchLink>
</PropertyGroup>

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.png" />

<MauiIcon Include="Resources\AppIcon\appicon.svg" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.png" Color="#062C53" BaseSize="256,88" />

Expand All @@ -78,7 +81,6 @@
<None Remove="Platforms\Android\Resources\drawable\widgetpreview.png" />
<None Remove="Platforms\Android\Resources\layout\rankwidget.axml" />
<None Remove="Platforms\Android\Resources\xml\appwidgetprovider.xml" />
<None Remove="Resources\AppIcon\appicon.png" />
<None Remove="Resources\Images\about.svg" />
<None Remove="Resources\Images\activity_feed.svg" />
<None Remove="Resources\Images\calendar.svg" />
Expand Down Expand Up @@ -110,37 +112,33 @@
</ItemGroup>

<ItemGroup>
<MauiIcon Include="Resources\AppIcon\appicon.png" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="AathifMahir.Maui.MauiIcons.Fluent" Version="1.1.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="5.2.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.3" />
<PackageReference Include="AathifMahir.Maui.MauiIcons.Fluent" Version="2.1.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="7.0.1" />
<PackageReference Include="LiveChartsCore.SkiaSharpView.Maui" Version="2.0.0-beta.911" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Maui.Controls.Maps" Version="7.0.92" />
<PackageReference Include="PinballApi" Version="2.2.0" />
<PackageReference Include="PureWeen.Maui.FixesAndWorkarounds" Version="1.4.9" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Maui.Controls.Maps" Version="8.0.3" />
<PackageReference Include="PinballApi" Version="2.3.0" />
<PackageReference Include="Scrutor" Version="4.2.2" />
<PackageReference Include="Serilog.Sinks.Xamarin" Version="1.0.0" />
<PackageReference Include="Shiny.Core" Version="$(ShinyVersion)" />
<PackageReference Include="Shiny.Hosting.Maui" Version="$(ShinyVersion)" />
<PackageReference Include="Shiny.Extensions.Configuration" Version="$(ShinyVersion)" />
<PackageReference Include="Shiny.Jobs" Version="$(ShinyVersion)" />
<PackageReference Include="Shiny.Notifications" Version="$(ShinyVersion)" />
<PackageReference Include="Shiny.Core" Version="3.2.2" />
<PackageReference Include="Shiny.Hosting.Maui" Version="3.2.2" />
<PackageReference Include="Shiny.Extensions.Configuration" Version="3.2.2" />
<PackageReference Include="Shiny.Jobs" Version="3.2.2" />
<PackageReference Include="Shiny.Notifications" Version="3.2.2" />
<PackageReference Include="sqlite-net-pcl" Version="1.8.116" />
<PackageReference Include="SQLitePCLRaw.core" Version="2.1.5" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.5" />
<PackageReference Include="SQLitePCLRaw.provider.dynamic_cdecl" Version="2.1.5" />
<PackageReference Include="SQLitePCLRaw.provider.sqlite3" Version="2.1.5" />
<PackageReference Include="Syncfusion.Maui.Core" Version="21.2.6" />
<PackageReference Include="Syncfusion.Maui.Scheduler" Version="21.2.6" />
<PackageReference Include="Syncfusion.Maui.TabView" Version="21.2.6" />
<PackageReference Include="System.ServiceModel.Syndication" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="Serilog" Version="3.0.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="SQLitePCLRaw.core" Version="2.1.7" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.7" />
<PackageReference Include="SQLitePCLRaw.provider.dynamic_cdecl" Version="2.1.7" />
<PackageReference Include="SQLitePCLRaw.provider.sqlite3" Version="2.1.7" />
<PackageReference Include="Syncfusion.Maui.Core" Version="24.1.45" />
<PackageReference Include="Syncfusion.Maui.Scheduler" Version="24.1.45" />
<PackageReference Include="Syncfusion.Maui.TabView" Version="24.1.45" />
<PackageReference Include="System.ServiceModel.Syndication" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
</ItemGroup>

Expand Down
7 changes: 2 additions & 5 deletions MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
using Ifpa.Controls;
using Shiny.Infrastructure;
using PinballApi;
using Maui.FixesAndWorkarounds;
using Microsoft.Maui.LifecycleEvents;
using Microsoft.Maui.Controls.Compatibility.Hosting;
using SkiaSharp.Views.Maui.Controls.Hosting;
using Serilog;
using Shiny;

namespace Ifpa;

Expand Down Expand Up @@ -77,8 +76,6 @@ static bool LogEvent(UIKit.UIApplication application, Foundation.NSUrl url, Foun
#endif
})
*/
//It's a real bummer that we have to port fixes like this and then wait an entire year for .NET MAUI releases
.ConfigureShellWorkarounds()
.RegisterShinyServices()
.RegisterIfpaModels()
.RegisterIfpaServices();
Expand Down Expand Up @@ -128,7 +125,7 @@ static MauiAppBuilder RegisterShinyServices(this MauiAppBuilder builder)
s.AddJobs();
s.AddShinyCoreServices();

s.AddJob(typeof(NotificationJob));
s.AddJob(typeof(NotificationJob), requiredNetwork: Shiny.Jobs.InternetAccess.Any, runInForeground: true);

// shiny.notifications
s.AddNotifications(typeof(NotificationDelegate));
Expand Down
Binary file removed Resources/AppIcon/appicon.png
Binary file not shown.
2 changes: 1 addition & 1 deletion Services/NotificationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public async Task SendNotification(string title, string description, string url)
};

var result = await notificationManager.RequestRequiredAccess(notification);
if (result == AccessState.Available)
if (result == Shiny.AccessState.Available)
{
await notificationManager.Send(notification);
}
Expand Down
11 changes: 6 additions & 5 deletions Views/CalendarDetailPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
xmlns:local="clr-namespace:Ifpa.Converters"
x:Class="Ifpa.Views.CalendarDetailPage"
xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
xmlns:fluent="clr-namespace:MauiIcons.Fluent;assembly=MauiIcons.Fluent"
xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:maps="http://schemas.microsoft.com/dotnet/2021/maui/maps"
ios:Page.LargeTitleDisplay="Never">
<ContentPage.Resources>
<ResourceDictionary>
Expand All @@ -17,8 +18,8 @@
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.ToolbarItems>
<ToolbarItem Text="Share" x:Name="ShareButton" Clicked="ShareButton_Clicked" IconImageSource="{fluent:Icon Icon=Share48, IconColor={StaticResource IconAccentColor}}" />
<ToolbarItem Text="Add To Calendar" x:Name="AddToCalendarButton" Clicked="AddToCalendarButton_Clicked" IconImageSource="{fluent:Icon Icon=CalendarAdd28, IconColor={StaticResource IconAccentColor}}" />
<ToolbarItem Text="Share" x:Name="ShareButton" Clicked="ShareButton_Clicked" IconImageSource="{mi:Fluent Icon=Share48, IconColor={StaticResource IconAccentColor}}" />
<ToolbarItem Text="Add To Calendar" x:Name="AddToCalendarButton" Clicked="AddToCalendarButton_Clicked" IconImageSource="{mi:Fluent Icon=CalendarAdd28, IconColor={StaticResource IconAccentColor}}" />
</ContentPage.ToolbarItems>
<Grid>
<ActivityIndicator IsVisible="{Binding IsBusy}" IsRunning="{Binding IsBusy}" />
Expand Down Expand Up @@ -49,8 +50,8 @@
</Label.FormattedText>
</Label>
</StackLayout>
<Map x:Name="calendarMap" MapType="Street" IsZoomEnabled="False" IsScrollEnabled="False" />

<maps:Map x:Name="calendarMap" MapType="Street" IsZoomEnabled="False" IsScrollEnabled="False" />

<ScrollView VerticalOptions="FillAndExpand" IsClippedToBounds="True" Padding="12,10">
<StackLayout>
Expand Down
Loading
Loading