Skip to content

Commit 6e6f46d

Browse files
Update TFM to .NET 9.0 and create shared dotnet setup action for workflows (#208)
- [x] Create global.json file with .NET 9.0 SDK version - [x] Update TFM in ListingManager.csproj from net8.0 to net9.0 - [x] Update TFM in ListingManager.Tests.csproj from net8.0 to net9.0 - [x] Create shared composite action for setup-dotnet in workflows - [x] Update build-and-test.yml to use shared action with global.json - [x] Update deploy.yml to use shared action with global.json - [x] Verify all tests pass with .NET 9.0 (71/77 passing - same as before) - [x] Verify packing continues to work with .NET 9.0 (successfully creates nupkg with net9.0 tools) - [x] Fix global.json to use version 9.0.100 (base SDK version) instead of 9.0.0 which doesn't exist <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > Update TFM to .net9.0 and global.json to .net 9.0 - make sure all tests and packing continue to work. > > In all workflows, make a shared action for setting up dotnet, in which instead of hard coding the .net version, let it target the global.json file > > - uses: actions/setup-dotnet@v5 > with: > global-json-file: csharp/global.json </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
1 parent 3ac3b09 commit 6e6f46d

6 files changed

Lines changed: 20 additions & 8 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: 'Setup .NET'
2+
description: 'Setup .NET SDK using global.json configuration'
3+
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: Setup .NET
8+
uses: actions/setup-dotnet@v5
9+
with:
10+
global-json-file: global.json

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ jobs:
3333
steps:
3434
- uses: actions/checkout@v5
3535
- name: Setup .NET
36-
uses: actions/setup-dotnet@v5
37-
with:
38-
dotnet-version: 8.x
36+
uses: ./.github/actions/setup-dotnet
3937
- name: Setup Dependency Caching
4038
uses: actions/cache@v4
4139
id: nuget-cache

.github/workflows/deploy.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v5
1919
- name: Setup .NET
20-
uses: actions/setup-dotnet@v5
21-
with:
22-
dotnet-version: 8.0
20+
uses: ./.github/actions/setup-dotnet
2321
- name: Setup Dependency Caching
2422
uses: actions/cache@v4
2523
id: nuget-cache

ListingManager.Tests/EssentialCSharp.ListingManager.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<IsPackable>false</IsPackable>
66
</PropertyGroup>
77

ListingManager/EssentialCSharp.ListingManager.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<PackAsTool>true</PackAsTool>
77
<ToolCommandName>ListingManager</ToolCommandName>
88
<RepositoryType>git</RepositoryType>

global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "9.0.100",
4+
"rollForward": "latestMinor"
5+
}
6+
}

0 commit comments

Comments
 (0)