Skip to content

Commit fe35c3a

Browse files
authored
Adds support for .NET 9 (#46)
1 parent 3c2520d commit fe35c3a

11 files changed

Lines changed: 46 additions & 436 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,42 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
with:
1414
fetch-depth: 0
1515
- name: Setup .NET
16-
uses: actions/setup-dotnet@v3
16+
uses: actions/setup-dotnet@v4
1717
with:
18-
dotnet-version: |
19-
3.1.x
20-
6.0.x
21-
7.0.x
18+
dotnet-version: 9.0.x
2219
- name: Retore Workload
2320
run: dotnet workload restore
2421
- name: Restore dependencies
2522
run: dotnet restore
26-
- name: Set Assembly Version
27-
run: ./build.sh --task=GitVersion --configuration=Release
23+
- name: Prepare assembly version
24+
id: version
25+
run: |
26+
VERSION=${{ github.event.release.name }}
27+
echo "assembly=${VERSION%-*}.${{ github.run_number }}" >> "$GITHUB_OUTPUT"
28+
- name: Update project version
29+
uses: vers-one/dotnet-project-version-updater@v1.7
30+
with:
31+
file: "**/*.csproj"
32+
version: ${{ github.event.release.name }}
33+
- name: Update assembly version
34+
uses: vers-one/dotnet-project-version-updater@v1.7
35+
with:
36+
file: "**/AssemblyInfo.cs"
37+
version: ${{ steps.version.outputs.assembly }}
2838
- name: Build Library
2939
run: dotnet build ./Float.TinCan.ActivityLibrary/Float.TinCan.ActivityLibrary.csproj --configuration Release --no-restore
30-
- name: Update Version
31-
run: sed -i "s/<Version><\/Version>/<Version>${{ github.event.release.name }}<\/Version>/" ./Float.TinCan.ActivityLibrary/Float.TinCan.ActivityLibrary.csproj
32-
- name: Pack and Upload
40+
- name: Pack
3341
run: dotnet pack --configuration Release --no-restore
34-
42+
- name: Archive artifact
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: Float.TinCan.ActivityLibrary.${{ github.event.release.name }}.nupkg
46+
path: ./Float.TinCan.ActivityLibrary/bin/Release/Float.TinCan.ActivityLibrary.${{ github.event.release.name }}.nupkg
47+
if-no-files-found: error
3548
- name: Deploy to NuGet
3649
env:
3750
FLOAT_NUGET_TOKEN: ${{ secrets.FLOAT_NUGET_TOKEN }}

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
- name: Setup .NET
14-
uses: actions/setup-dotnet@v3
14+
uses: actions/setup-dotnet@v4
1515
with:
1616
dotnet-version: |
17-
3.1.x
1817
7.0.x
1918
8.0.x
19+
9.0.x
2020
- name: Retore Workload
2121
run: dotnet workload restore
2222
- name: Restore dependencies

Float.TinCan.ActivityLibrary.Tests/Float.TinCan.ActivityLibrary.Tests.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netcoreapp3.1;net7.0;net8.0;</TargetFrameworks>
3+
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
44
<IsPackable>false</IsPackable>
55
<LangVersion>9.0</LangVersion>
66
<UseMaui>true</UseMaui>
@@ -19,9 +19,15 @@
1919
<PrivateAssets>all</PrivateAssets>
2020
</PackageReference>
2121
</ItemGroup>
22+
<ItemGroup Condition="$(TargetFramework.StartsWith('net7'))">
23+
<PackageReference Include="Microsoft.Maui.Controls" Version="[8.0.20,9)" />
24+
</ItemGroup>
2225
<ItemGroup Condition="$(TargetFramework.StartsWith('net8'))">
2326
<PackageReference Include="Microsoft.Maui.Controls" Version="[8.0.20,9)" />
2427
</ItemGroup>
28+
<ItemGroup Condition="$(TargetFramework.StartsWith('net9'))">
29+
<PackageReference Include="Microsoft.Maui.Controls" Version="[9.0.0,10)" />
30+
</ItemGroup>
2531
<ItemGroup>
2632
<ProjectReference Include="..\Float.TinCan.ActivityLibrary\Float.TinCan.ActivityLibrary.csproj" />
2733
</ItemGroup>

Float.TinCan.ActivityLibrary/Float.TinCan.ActivityLibrary.csproj

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netstandard2;net7.0;net8.0;</TargetFrameworks>
3+
<TargetFrameworks>netstandard2;net7.0;net8.0;net9.0;</TargetFrameworks>
44
<AssemblyName>Float.TinCan.ActivityLibrary</AssemblyName>
55
<AssemblyAuthor>Float</AssemblyAuthor>
66
<AssemblyDescription>A library for starting xAPI activities.</AssemblyDescription>
@@ -12,7 +12,7 @@
1212
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
1313
<LangVersion>9.0</LangVersion>
1414
<ReleaseVersion>1.0.0</ReleaseVersion>
15-
<Version></Version>
15+
<Version>0.0.1</Version>
1616
<UseMaui>true</UseMaui>
1717
</PropertyGroup>
1818
<ItemGroup>
@@ -35,15 +35,21 @@
3535
<PackageReference Include="Float.FileDownloader" Version="1.0.0.44" />
3636
<PackageReference Include="Float.TinCan" Version="1.0.3.30" />
3737
<PackageReference Include="Float.TinCan.LocalLRSServer" Version="2.1.0" />
38-
<PackageReference Include="Float.Core" Version="2.0.0" />
38+
<PackageReference Include="Float.Core" Version="[2.0.0,]" />
3939
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
4040
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4141
<PrivateAssets>all</PrivateAssets>
4242
</PackageReference>
4343
</ItemGroup>
44+
<ItemGroup Condition="$(TargetFramework.StartsWith('net7'))">
45+
<PackageReference Include="Microsoft.Maui.Controls" Version="[8.0.20,9)" />
46+
</ItemGroup>
4447
<ItemGroup Condition="$(TargetFramework.StartsWith('net8'))">
4548
<PackageReference Include="Microsoft.Maui.Controls" Version="[8.0.20,9)" />
4649
</ItemGroup>
50+
<ItemGroup Condition="$(TargetFramework.StartsWith('net9'))">
51+
<PackageReference Include="Microsoft.Maui.Controls" Version="[9.0.0,10)" />
52+
</ItemGroup>
4753
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard'))">
4854
<PackageReference Include="Xamarin.Forms" Version="[5.0.0.1874,6)" />
4955
</ItemGroup>

build.cake

Lines changed: 0 additions & 190 deletions
This file was deleted.

0 commit comments

Comments
 (0)