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

[656] Uplift to dotnet 9 #703

Merged
merged 21 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion .github/actions/publish-ui-dist/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ runs:
echo "RUNNER_TOOL_CACHE=$Env:RUNNER_TOOL_CACHE" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
shell: pwsh

# dotnet publish src/ClientUI/ClientUI.csproj -c Release -f net7.0-windows10.0.19041.0 -p:RuntimeIdentifierOverride=win10-x64 -p:PublishSingleFile=true -p:SelfContained=true
# dotnet publish src/ClientUI/ClientUI.csproj -c Release -f net9.0-windows10.0.19041.0 -p:RuntimeIdentifierOverride=win-x64 -p:PublishSingleFile=true -p:SelfContained=true
philosowaffle marked this conversation as resolved.
Show resolved Hide resolved
- name: Publish ${{ inputs.os }}
run: dotnet publish ${{ github.workspace }}/src/ClientUI/ClientUI.csproj -c Release -f ${{ inputs.framework }} -p:RuntimeIdentifierOverride=${{ inputs.os }} -p:PublishSingleFile=true -p:SelfContained=true
shell: pwsh
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/housekeeping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Housekeeping Tasks
on:
workflow_dispatch:
schedule:
- cron: 0 0 1 * * # monthly
- cron: 0 0 2 * * # bi-monthly

jobs:

Expand All @@ -19,9 +19,6 @@ jobs:
title: "[Housekeeping] Dependency Bump"
body: |
### Tasks

- [ ] Pull in latest [Garmin SDK](https://forums.garmin.com/developer/fit-sdk/w/fit-sdk-wiki/92/fit-sdk-release-notes)
- [ ] See if any new features we can take advantage of
- [ ] Bump all Dependencies to latest
pinned: false
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: PR Check
on:
workflow_dispatch:
pull_request:
branches: [ master, v4-wip ]
branches: [ master, v5-wip ]

jobs:

Expand Down Expand Up @@ -53,9 +53,9 @@ jobs:
needs: build-and-test
philosowaffle marked this conversation as resolved.
Show resolved Hide resolved
strategy:
matrix:
dotnet: [ '7.0.410' ]
framework: ['net7.0-windows10.0.19041.0']
os: [ 'win10-x64' ]
dotnet: [ '9.0.101' ]
framework: ['net9.0-windows10.0.19041.0']
os: [ 'win-x64' ]

steps:

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
runs-on: 'windows-latest'
strategy:
matrix:
dotnet: [ '7.0.410' ]
framework: ['net7.0-windows10.0.19041.0']
os: [ 'win10-x64' ]
dotnet: [ '9.0.101' ]
framework: ['net9.0-windows10.0.19041.0']
os: [ 'win-x64' ]

steps:

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ jobs:
artifact_name: ${{ steps.win-ui-create-artifact.outputs.artifact_name }}
strategy:
matrix:
dotnet: [ '7.0.410' ]
framework: ['net7.0-windows10.0.19041.0']
os: [ 'win10-x64' ]
dotnet: [ '9.0.101' ]
framework: ['net9.0-windows10.0.19041.0']
os: [ 'win-x64' ]

steps:

Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,7 @@ configuration.local.json
/src/ClientUI/ClientUI.csproj.user

# docs
/mkdocs/site
/mkdocs/site
/src/Api/Api.csproj.user
/src/Api.Service/Api.Service.csproj.user
/PelotonToGarmin.slnLaunch.user
4 changes: 2 additions & 2 deletions docker/Dockerfile.api
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###################
# CREATE FINAL LAYER
###################
FROM mcr.microsoft.com/dotnet/aspnet:7.0 as final
FROM mcr.microsoft.com/dotnet/aspnet:9.0 as final

RUN apt-get update \
&& apt-get -y install bash tzdata \
Expand All @@ -19,7 +19,7 @@ RUN mkdir -m770 {output,data,working}
###################
# BUILD LAYER
###################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build

COPY . /build
WORKDIR /build
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.console
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###################
# CREATE FINAL LAYER
###################
FROM mcr.microsoft.com/dotnet/aspnet:7.0 as final
FROM mcr.microsoft.com/dotnet/aspnet:9.0 as final

RUN apt-get update \
&& apt-get -y install bash tzdata \
Expand All @@ -19,7 +19,7 @@ RUN mkdir -m770 {output,data,working}
###################
# BUILD LAYER
###################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build

COPY . /build
WORKDIR /build
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.webui
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###################
# CREATE FINAL LAYER
###################
FROM mcr.microsoft.com/dotnet/aspnet:7.0 as final
FROM mcr.microsoft.com/dotnet/aspnet:9.0 as final

RUN apt-get update \
&& apt-get -y install bash tzdata \
Expand All @@ -17,7 +17,7 @@ WORKDIR /app
###################
# BUILD LAYER
###################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build

COPY . /build
WORKDIR /build
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "7.0.410"
"version": "9.0.101"
}
}
24 changes: 2 additions & 22 deletions mkdocs/docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Ensure that your code:

## Development

1. Install [dotent 6.0 runtime](https://dotnet.microsoft.com/download/dotnet/6.0/runtime)
1. Install [dotent 9.0 runtime](https://dotnet.microsoft.com/download/dotnet/9.0/runtime)

```
> dotnet restore
Expand All @@ -23,27 +23,7 @@ Ensure that your code:

## Package Windows exe
```
> dotnet publish ./src/ConsoleClient/ConsoleClient.csproj --no-restore -c Release -r win10-x64 -o ./dist --version-suffix local
```

## Developing against garmin-upload python library

1. Install [Python 3](https://www.python.org/downloads/) and pip
1. Set `"PythonAndGUploadInstalled": true`

```bash
> cd peloton-to-garmin
> cd python
> pip install -r requirements.txt
```

### Compile python exe

``` bash
> cd python
> pip install -r requirements.txt
> pip install pyinstaller
> pyinstaller -n upload --distpath ./ --console --clean --noconfirm upload.py
> dotnet publish ./src/ConsoleClient/ConsoleClient.csproj --no-restore -c Release -r win-x64 -o ./dist --version-suffix local
```

## Contribute to the docs
Expand Down
36 changes: 36 additions & 0 deletions mkdocs/docs/migration/migrate-v4-v5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

# Migrating from V4 to V5

Version 3 only includes one breaking change that some users will need to account for. Based on your install type you can find what changes need to be made below.

## Windows Exe

The P2G windows exe now provides a proper user interface. You can migrate to this new version simply by following the [install steps](../install/windows.md). You will need to re-configure P2G using the user interface as your settings will not migrate over.

There is no risk installing v4 and trying it out. Your previous install will continue to work while you test out v4. When you're satisfied with v4 you can delete your previous version of P2G.

## GitHub Action

Follow the [updating instructions for GitHub Actions](../install/github-action.md#updating). A couple notable changes that will be pulled in:

1. [Container Image tag](https://github.com/philosowaffle/peloton-to-garmin/blob/v4.0.0/.github/workflows/sync_peloton_to_garmin.yml#L23) has changed to `console-stable`, you may wish to edit this to be `console-v4`
1. The [configuration options](https://github.com/philosowaffle/peloton-to-garmin/blob/v4.0.0/.github/workflows/sync_peloton_to_garmin.yml#L40) have changed slightly with some fields being deprecated and removed
1. The [command to run p2g](https://github.com/philosowaffle/peloton-to-garmin/blob/v4.0.0/.github/workflows/sync_peloton_to_garmin.yml#L75) has changed to `/app/ConsoleClient`.

## Docker Headless

No specific migration steps are needed, however please take note of the [breaking changes](https://github.com/philosowaffle/peloton-to-garmin/releases/tag/v3.6.0) in case any of these impact your setup.

## Docker WebUI

No specific migration steps are needed, however please take note of the [breaking changes](https://github.com/philosowaffle/peloton-to-garmin/releases/tag/v3.6.0) in case any of these impact your setup.

## Docker API

No specific migration steps are needed, however please take note of the [breaking changes](https://github.com/philosowaffle/peloton-to-garmin/releases/tag/v3.6.0) in case any of these impact your setup.

## Source

1. Install the latest [dotnet 9.0 SDK](https://dotnet.microsoft.com/download/dotnet/7.0)

Please take note of the [breaking changes](https://github.com/philosowaffle/peloton-to-garmin/releases/tag/v5.0.0) in case any of these impact your setup.
1 change: 1 addition & 0 deletions mkdocs/docs/migration/migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ P2G uses major release versions to designate when a breaking or non-backwards co
1. [Migrating from V1 to V2](migrate-v1-v2.md)
1. [Migrating from V2 to V3](migrate-v2-v3.md)
1. [Migrating from V3 to V4](migrate-v3-v4.md)
1. [Migrating from V3 to V4](migrate-v4-v5.md)
philosowaffle marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion src/Api.Contract/Api.Contract.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Api.Contract/SettingsContracts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class SettingsGarminPostRequest
public bool TwoStepVerificationEnabled { get; set; }
public bool Upload { get; set; }
public FileFormat FormatToUpload { get; set; }
public GarminApiSettings Api { get; set; }
public GarminApiSettings Api { get; set; } = new GarminApiSettings();
}

public class SettingsPelotonGetResponse
Expand Down
2 changes: 1 addition & 1 deletion src/Api.Service/Api.Service.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Api/Api.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<PackageId>PelotonToGarmin.Api</PackageId>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RuntimeIdentifiers>win10-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<PackageProjectUrl>https://github.com/philosowaffle/peloton-to-garmin</PackageProjectUrl>
<RepositoryUrl>https://github.com/philosowaffle/peloton-to-garmin</RepositoryUrl>
<Authors>Bailey Belvis</Authors>
Expand All @@ -26,7 +26,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/ClientUI/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
public App()
{
InitializeComponent();
}

MainPage = new MainPage();
protected override Window CreateWindow(IActivationState? activationState)

Check warning on line 10 in src/ClientUI/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build-and-test (7.0, windows-latest, net7.0-windows10.0.19041.0)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
return new Window(new MainPage());
}
}
}
53 changes: 21 additions & 32 deletions src/ClientUI/ClientUI.csproj
Original file line number Diff line number Diff line change
@@ -1,47 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<!--<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</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);net7.0-tizen</TargetFrameworks> -->
<MauiVersion>9.0.0</MauiVersion>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>ClientUI</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<EnableDefaultCssItems>false</EnableDefaultCssItems>

<WindowsPackageType Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">None</WindowsPackageType>
<WindowsAppSDKSelfContained Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">true</WindowsAppSDKSelfContained>
<UseMaui>true</UseMaui>
<WindowsPackageType>None</WindowsPackageType>
<PublishReadyToRun>false</PublishReadyToRun>

<!-- Display name -->
<ApplicationTitle>PelotonToGarmin</ApplicationTitle>

<Title>P2G ClientUI</Title>
<Authors>Philosowaffle</Authors>
<Product>P2G ClientUI</Product>

<!-- App Identifier -->
<ApplicationId>com.philosowaffle.pelotontogarmin.clientui</ApplicationId>
<ApplicationIdGuid>B01486E7-1F8D-4350-B68E-874A02A96694</ApplicationIdGuid>

<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<ApplicationDisplayVersion>5.0.0</ApplicationDisplayVersion>
<ApplicationVersion>5</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.19041.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.19041.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
<Title>P2G ClientUI</Title>
<Authors>Philosowaffle</Authors>
<Product>P2G ClientUI</Product>
</PropertyGroup>

<!--<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">
<WindowsSdkPackageVersion>10.0.19041.52</WindowsSdkPackageVersion>
</PropertyGroup>-->

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
Expand All @@ -57,28 +46,28 @@
<MauiFont Include="Resources\Fonts\*" />

<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<Content Remove="Resources\Raw\configuration.local.json" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.20" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<ProjectReference Include="..\SharedUI\SharedUI.csproj" />
<ProjectReference Include="..\Api.Service\Api.Service.csproj" />
<ProjectReference Include="..\Common\Common.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SharedUI\SharedUI.csproj" />
<ProjectReference Include="..\Api.Service\Api.Service.csproj" />
<ProjectReference Include="..\Common\Common.csproj" />
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.21" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.21" />
</ItemGroup>

<ItemGroup>
<None Update="Resources\Splash\P2G-Splash.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Update="Resources\Splash\P2G-Splash.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Loading
Loading