Skip to content

Commit f1fc455

Browse files
authored
Migrate to .NET 10 (#39)
* Migrate to .NET 10 * Update Paths.fs * remove unused packagereference * remove net6.0 support * remove net9.0 dotnet run from scripts
1 parent 3127b1d commit f1fc455

12 files changed

Lines changed: 49 additions & 76 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,17 @@ jobs:
1818
build:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v5
2222
with:
2323
fetch-depth: 1
2424
- run: |
2525
git fetch --prune --unshallow --tags
2626
echo exit code $?
2727
git tag --list
28-
- uses: actions/setup-dotnet@v4
28+
- uses: actions/setup-dotnet@v5
2929
with:
30-
# 6.x is required to run generate release notes (for now)
3130
dotnet-version: |
32-
9.0.x
33-
6.0.x
31+
10.0.x
3432
source-url: https://nuget.pkg.github.com/nullean/index.json
3533
env:
3634
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
@@ -61,6 +59,6 @@ jobs:
6159
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags')
6260
name: Create or update release for tag on github
6361

64-
- run: dotnet nuget push build/output/*.nupkg -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols true
62+
- run: dotnet nuget push 'build/output/*.nupkg' -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols true
6563
name: release to nuget.org
6664
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags')

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<MinVerDefaultPreReleaseIdentifiers>canary.0</MinVerDefaultPreReleaseIdentifiers>
5-
<MinVerMinimumMajorMinor>0.2</MinVerMinimumMajorMinor>
5+
<MinVerMinimumMajorMinor>0.1</MinVerMinimumMajorMinor>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="MinVer" Version="2.5.0">
8+
<PackageReference Include="MinVer" Version="6.0.0">
99
<PrivateAssets>all</PrivateAssets>
1010
</PackageReference>
1111
</ItemGroup>

assembly-differ.sln

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

assembly-differ.slnx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Solution>
2+
<Folder Name="/build/">
3+
<File Path=".github/workflows/ci.yml" />
4+
<File Path="build.bat" />
5+
<File Path="build.sh" />
6+
<File Path="Directory.Build.props" />
7+
<File Path="dotnet-tools.json" />
8+
<File Path="global.json" />
9+
<File Path="LICENSE" />
10+
<File Path="nuget-icon.png" />
11+
<File Path="README.md" />
12+
<Project Path="build/scripts/scripts.fsproj" />
13+
</Folder>
14+
<Folder Name="/src/">
15+
<Project Path="src/assembly-differ/assembly-differ.csproj" />
16+
</Folder>
17+
</Solution>

build/scripts/Paths.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let Repository = sprintf "nullean/%s" ToolName
88

99
let Root =
1010
let mutable dir = DirectoryInfo(".")
11-
while dir.GetFiles("*.sln").Length = 0 do dir <- dir.Parent
11+
while dir.GetFiles("*.slnx").Length = 0 do dir <- dir.Parent
1212
Environment.CurrentDirectory <- dir.FullName
1313
dir
1414

build/scripts/Program.fs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ let main argv =
2626
Targets.Setup parsed arguments
2727
let swallowTypes = [typeof<ProcExecException>; typeof<ExceptionExiter>]
2828

29-
Targets.RunTargetsAndExit
30-
([target], (fun e -> swallowTypes |> List.contains (e.GetType()) ), ":")
29+
task {
30+
return! Targets.RunTargetsAndExitAsync([ target ], (fun e -> swallowTypes |> List.contains (e.GetType())), (fun _ -> ":"), null, null)
31+
} |> Async.AwaitTask |> Async.RunSynchronously
3132
0
3233

build/scripts/Targets.fs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,19 @@ open Fake.Tools.Git
99
open ProcNet
1010

1111
let exec binary args =
12-
let r = Proc.Exec (binary, args |> List.map (fun a -> sprintf "\"%s\"" a) |> List.toArray)
13-
match r.HasValue with | true -> r.Value | false -> failwithf "invocation of `%s` timed out" binary
12+
Proc.Exec (binary, args |> List.toArray)
1413

1514
let private restoreTools = lazy(exec "dotnet" ["tool"; "restore"])
1615
let private currentVersion =
1716
lazy(
1817
restoreTools.Value |> ignore
19-
let r = Proc.Start("dotnet", "minver", "-p", "canary.0")
18+
let r = Proc.Start("dotnet", "minver", "-p", "canary.0", "-m", "0.1")
2019
let o = r.ConsoleOut |> Seq.find (fun l -> not(l.Line.StartsWith "MinVer:"))
2120
o.Line
2221
)
2322

2423
let private currentVersionInformational =
25-
lazy(
26-
sprintf "%s+%s" currentVersion.Value (Information.getCurrentSHA1( "."))
27-
)
24+
lazy(sprintf "%s+%s" currentVersion.Value (Information.getCurrentSHA1( ".")))
2825

2926
let private clean (arguments:ParseResults<Arguments>) =
3027
if (Paths.Output.Exists) then Paths.Output.Delete (true)
@@ -53,11 +50,11 @@ let private generateApiChanges (arguments:ParseResults<Arguments>) =
5350
let output = Paths.RootRelative <| Paths.Output.FullName
5451
let currentVersion = currentVersion.Value
5552
let project = Paths.RootRelative Paths.ToolProject.FullName
56-
let dotnetRun =[ "run"; "-c"; "Release"; "-f"; "net9.0"; "--project"; project]
53+
let dotnetRun =[ "run"; "-c"; "Release"; "-f"; "net10.0"; "--project"; project]
5754
let args =
5855
[
5956
sprintf "previous-nuget|%s|%s|net8.0" Paths.ToolName currentVersion;
60-
sprintf "directory|src/%s/bin/Release/net9.0" Paths.ToolName;
57+
sprintf "directory|src/%s/bin/Release/net10.0" Paths.ToolName;
6158
"--target"; Paths.ToolName; "-f"; "github-comment"; "--output"; output
6259
]
6360

build/scripts/scripts.fsproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88
<ItemGroup>
99
<PackageReference Include="Argu" Version="6.2.5" />
10-
<PackageReference Include="Bullseye" Version="3.3.0" />
11-
<PackageReference Include="Proc" Version="0.6.2" />
10+
<PackageReference Include="Bullseye" Version="6.0.0" />
11+
<PackageReference Include="Proc" Version="0.9.1" />
1212
<PackageReference Include="Fake.Tools.Git" Version="5.20.3" />
13-
<PackageReference Update="MinVer" Version="4.3.0" />
1413
</ItemGroup>
1514

1615
<ItemGroup>

dotnet-tools.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,25 @@
33
"isRoot": true,
44
"tools": {
55
"minver-cli": {
6-
"version": "4.3.0",
6+
"version": "6.0.0",
77
"commands": [
88
"minver"
9-
]
9+
],
10+
"rollForward": false
1011
},
1112
"release-notes": {
12-
"version": "0.6.0",
13+
"version": "0.10.0",
1314
"commands": [
1415
"release-notes"
15-
]
16+
],
17+
"rollForward": false
1618
},
1719
"nupkg-validator": {
18-
"version": "0.6.0",
20+
"version": "0.10.1",
1921
"commands": [
2022
"nupkg-validator"
21-
]
23+
],
24+
"rollForward": false
2225
}
2326
}
2427
}

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "9.0.100",
3+
"version": "10.0.100",
44
"rollForward": "latestFeature",
55
"allowPrerelease": false
66
}

0 commit comments

Comments
 (0)