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 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
54 changes: 38 additions & 16 deletions .github/actions/publish-ui-dist/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ inputs:
framework:
description: 'DotNet Framework'
required: true
os-path:
description: 'The folder pathname used when built'
required: false
default: 'win10-x64'
os:
description: 'The OS we are running on'
required: true
Expand All @@ -21,6 +25,17 @@ runs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ inputs.dotnet-version }}

- name: List SDKs
run: dotnet --list-sdks
shell: pwsh

# I really shouldn't need to do this. The restore command below should be enough.
# However it seems the restore command does not install Maui base, which is needed
# to publish a running package.
- name: Install MAUI Workloads
run: dotnet workload install maui
shell: pwsh

- name: Restore MAUI Workloads
run: dotnet workload restore
Expand All @@ -36,33 +51,40 @@ 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
- name: Clean
run: dotnet clean --configuration Debug && dotnet nuget locals all --clear
shell: pwsh

- name: Restore
run: dotnet restore
shell: pwsh

# 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

- name: Rename Config
run: Rename-Item ${{ github.workspace }}/src/ClientUI/bin/Release/${{ inputs.framework }}/${{ inputs.os }}/configuration.example.json -NewName configuration.local.json
- name: Log Dependencies
run: dotnet list package --include-transitive
shell: pwsh

- name: Remove nested Publish Dir
run: Remove-Item ${{ github.workspace }}/src/ClientUI/bin/Release/${{ inputs.framework }}/${{ inputs.os }}/publish -Recurse
shell: pwsh
# - name: Remove nested Publish Dir
# run: Remove-Item ${{ github.workspace }}/src/ClientUI/bin/Release/${{ inputs.framework }}/${{ inputs.os-path }}/publish -Recurse
# shell: pwsh

# Create Build Artifact
- name: Upload Artifact ui_${{ inputs.os }}_${{ github.run_number }}-${{ github.run_id }}
uses: actions/upload-artifact@v4
with:
name: ui_${{ inputs.os }}_${{ github.run_number }}-${{ github.run_id }}
path: ${{ github.workspace }}/src/ClientUI/bin/Release/${{ inputs.framework }}/${{ inputs.os }}
path: ${{ github.workspace }}/src/ClientUI/bin/Release/${{ inputs.framework }}/${{ inputs.os-path }}


# Installed Workload Id Manifest Version Installation Source
# ---------------------------------------------------------------------
# maui-android 7.0.92/7.0.100 VS 17.7.34031.279
# android 33.0.68/7.0.100 VS 17.7.34031.279
# ios 16.4.7098/7.0.100 VS 17.7.34031.279
# maui-ios 7.0.92/7.0.100 VS 17.7.34031.279
# maui-windows 7.0.92/7.0.100 VS 17.7.34031.279
# maui-maccatalyst 7.0.92/7.0.100 VS 17.7.34031.279
# maccatalyst 16.4.7098/7.0.100 VS 17.7.34031.279
# ---------------------------------------------------------------------------------
# android 35.0.7/9.0.100 SDK 9.0.100, VS 17.12.35527.113
# aspire 8.2.2/8.0.100 SDK 9.0.100, VS 17.12.35527.113
# ios 18.1.9163/9.0.100 SDK 9.0.100, VS 17.12.35527.113
# maccatalyst 18.1.9163/9.0.100 SDK 9.0.100, VS 17.12.35527.113
# maui 9.0.0/9.0.100 SDK 9.0.100
# maui-windows 9.0.0/9.0.100 SDK 9.0.100, VS 17.12.35527.113
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
12 changes: 6 additions & 6 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ name: PR Check
on:
workflow_dispatch:
pull_request:
branches: [ master, v4-wip ]
branches: [ master, v5-wip ]

jobs:

build-and-test:
strategy:
matrix:
dotnet: ['7.0']
dotnet: ['9.0.101']
os: [windows-latest]
framework: ['net7.0-windows10.0.19041.0']
framework: ['net9.0-windows10.0.19041.0']

runs-on: ${{ matrix.os }}

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
10 changes: 5 additions & 5 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 All @@ -72,6 +72,8 @@ jobs:
needs: [publish-ui-dist, publish-docker-images]
steps:

- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: ${{ needs.publish-ui-dist.outputs.artifact_name }}
Expand All @@ -82,8 +84,6 @@ jobs:
with:
files: /downloaded # must be relative to gh workspace, does not support absolute paths :(
dest: ui_win_${{ github.event.inputs.version }}.zip # this is hardcoded to output to ${{ github.workspace }}/ :(

- uses: actions/checkout@v4

- name: Create Release and Upload Artifacts
uses: ncipollo/release-action@v1
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
5 changes: 4 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"sdk": {
"version": "7.0.410"
"version": "9.0.101"
},
"msbuild-sdks": {
"Microsoft.NET.Sdk.Maui": "9.0.100"
}
}
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 V4 to V5](migrate-v4-v5.md)
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
Loading
Loading