Skip to content
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
15 changes: 5 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,17 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v5
with:
fetch-depth: 1
- run: |
git fetch --prune --unshallow --tags
echo exit code $?
git tag --list
- uses: actions/setup-dotnet@v1
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '3.1.404'
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.100'
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.302'
dotnet-version: |
10.0.x
source-url: https://nuget.pkg.github.com/nullean/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
Expand All @@ -51,7 +46,7 @@ jobs:
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads')
shell: bash
run: |
until dotnet nuget push build/output/*.nupkg -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate --no-symbols true; do echo "Retrying"; sleep 1; done;
until dotnet nuget push 'build/output/*.nupkg' -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate --no-symbols true; do echo "Retrying"; sleep 1; done;

- run: ./build.sh generatereleasenotes -s true
name: Generate release notes for tag
Expand Down
5 changes: 3 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MinVerDefaultPreReleasePhase>canary</MinVerDefaultPreReleasePhase>
<MinVerDefaultPreReleaseIdentifiers>canary.0</MinVerDefaultPreReleaseIdentifiers>
<MinVerMinimumMajorMinor>0.1</MinVerMinimumMajorMinor>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MinVer" Version="2.3.1">
<PackageReference Include="MinVer" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions build/scripts/CommandLine.fs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ with
interface IArgParserTemplate with
member this.Usage =
match this with
| Clean _ -> "clean known output locations"
| Build _ -> "Run build and tests"
| Release _ -> "runs build, and create an validates the packages shy of publishing them"
| Publish _ -> "Runs the full release"
| Clean -> "clean known output locations"
| Build -> "Run build and tests"
| Release -> "runs build, and create an validates the packages shy of publishing them"
| Publish -> "Runs the full release"

| SingleTarget _ -> "Runs the provided sub command without running their dependencies"
| Token _ -> "Token to be used to authenticate with github"
Expand Down
2 changes: 1 addition & 1 deletion build/scripts/Paths.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let Repository = sprintf "nullean/%s" ToolName

let Root =
let mutable dir = DirectoryInfo(".")
while dir.GetFiles("*.sln").Length = 0 do dir <- dir.Parent
while dir.GetFiles("*.slnx").Length = 0 do dir <- dir.Parent
Environment.CurrentDirectory <- dir.FullName
dir

Expand Down
5 changes: 3 additions & 2 deletions build/scripts/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ let main argv =
Targets.Setup parsed arguments
let swallowTypes = [typeof<ProcExecException>; typeof<ExceptionExiter>]

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

17 changes: 9 additions & 8 deletions build/scripts/Targets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ open ProcNet


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

let private restoreTools = lazy(exec "dotnet" ["tool"; "restore"])
let private currentVersion =
lazy(
restoreTools.Value |> ignore
let r = Proc.Start("dotnet", "minver", "-d=canary")
let r = Proc.Start("dotnet", "minver", "-p=canary.0", "-v=e", "-m=0.1")
let o = r.ConsoleOut |> Seq.find (fun l -> not(l.Line.StartsWith("MinVer:")))
o.Line
)
let private currentVersionInformational =
lazy (sprintf "%s+%s" currentVersion.Value (Information.getCurrentSHA1 "."))

let private clean (arguments:ParseResults<Arguments>) =
if (Paths.Output.Exists) then Paths.Output.Delete (true)
Expand All @@ -41,16 +42,16 @@ let private validatePackages (arguments:ParseResults<Arguments>) =
let nugetPackage =
let p = Paths.Output.GetFiles("*.nupkg") |> Seq.sortByDescending(fun f -> f.CreationTimeUtc) |> Seq.head
Paths.RootRelative p.FullName
exec "dotnet" ["nupkg-validator"; nugetPackage; "-v"; currentVersion.Value; "-a"; Paths.ToolName; "-k"; "96c599bbe3e70f5d"] |> ignore
exec "dotnet" ["nupkg-validator"; nugetPackage; "-v"; currentVersionInformational.Value; "-a"; Paths.ToolName; "-k"; "96c599bbe3e70f5d"] |> ignore

let private generateApiChanges (arguments:ParseResults<Arguments>) =
let output = Paths.RootRelative <| Paths.Output.FullName
let currentVersion = currentVersion.Value
let args =
[
"assembly-differ"
(sprintf "previous-nuget|%s|%s|netcoreapp3.1" Paths.ToolName currentVersion);
(sprintf "directory|src/%s/bin/Release/netcoreapp3.1" Paths.ToolName);
(sprintf "previous-nuget|%s|%s|net10.0" Paths.ToolName currentVersion);
(sprintf "directory|src/%s/bin/Release/net10.0" Paths.ToolName);
"--target"; "release-notes"; "-f"; "github-comment"; "--output"; output
]

Expand All @@ -61,7 +62,7 @@ let private generateReleaseNotes (arguments:ParseResults<Arguments>) =
let currentVersion = currentVersion.Value
let output =
Paths.RootRelative <| Path.Combine(Paths.Output.FullName, sprintf "release-notes-%s.md" currentVersion)
let dotnetRun =[ "run"; "-c"; "Release"; "-f"; "net5.0"; "-p"; project]
let dotnetRun =[ "run"; "-c"; "Release"; "-f"; "net10.0"; "-p"; project]
let tokenArgs =
match arguments.TryGetResult Token with
| None -> []
Expand All @@ -80,7 +81,7 @@ let private generateReleaseNotes (arguments:ParseResults<Arguments>) =
let private createReleaseOnGithub (arguments:ParseResults<Arguments>) =
let project = Paths.RootRelative Paths.ToolProject.FullName
let currentVersion = currentVersion.Value
let dotnetRun =[ "run"; "-c"; "Release"; "-f"; "net5.0"; "-p"; project]
let dotnetRun =[ "run"; "-c"; "Release"; "-f"; "net10.0"; "-p"; project]
let tokenArgs =
match arguments.TryGetResult Token with
| None -> []
Expand Down
6 changes: 3 additions & 3 deletions build/scripts/scripts.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Argu" Version="6.0.0" />
<PackageReference Include="Bullseye" Version="3.3.0" />
<PackageReference Include="Proc" Version="0.6.2" />
<PackageReference Include="Bullseye" Version="6.0.0" />
<PackageReference Include="Proc" Version="0.9.1" />
<PackageReference Include="Fake.Tools.Git" Version="5.15.0" />
</ItemGroup>

Expand Down
15 changes: 9 additions & 6 deletions dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@
"isRoot": true,
"tools": {
"minver-cli": {
"version": "2.3.1",
"version": "6.0.0",
"commands": [
"minver"
]
],
"rollForward": false
},
"nupkg-validator": {
"version": "0.5.0",
"version": "0.10.0",
"commands": [
"nupkg-validator"
]
],
"rollForward": false
},
"assembly-differ": {
"version": "0.11.1",
"version": "0.16.0",
"commands": [
"assembly-differ"
]
],
"rollForward": false
}
}
}
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.302",
"version": "10.0.100",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down
39 changes: 0 additions & 39 deletions release-notes.sln

This file was deleted.

15 changes: 15 additions & 0 deletions release-notes.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Solution>
<Folder Name="/build/">
<File Path=".editorconfig" />
<File Path=".github/workflows/ci.yml" />
<File Path="Directory.Build.props" />
<File Path="global.json" />
<File Path="LICENSE" />
<File Path="nuget-icon.png" />
<File Path="README.md" />
<Project Path="build/scripts/scripts.fsproj" />
</Folder>
<Folder Name="/src/">
<Project Path="src/release-notes/release-notes.fsproj" />
</Folder>
</Solution>
4 changes: 2 additions & 2 deletions src/release-notes/Arguments.fs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ type Arguments =
| Version _ -> "Version that is being released"
| Token _ -> "The github token to use, if the issue list is long this may be necessary, defaults to anonymous"

| ApplyLabels _ -> "Creates version and backport labels"
| FindPreviousVersion _ -> "Find the previous release for the passed version"
| ApplyLabels -> "Creates version and backport labels"
| FindPreviousVersion -> "Find the previous release for the passed version"
| CurrentVersion _ -> "Given search syntax finds the current and the next versions on separate lines"
| CreateRelease _ -> "Makes sure the tag exists as release on github and introduces new version labels for the next major/minor/patch"

Expand Down
2 changes: 1 addition & 1 deletion src/release-notes/release-notes.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.0;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<AssemblyName>release-notes</AssemblyName>
<RootNamespace>ReleaseNotes</RootNamespace>
<PackAsTool>true</PackAsTool>
Expand Down