From d519cd967b22a3e23b83e9039a6cb6eb2c1a18fc Mon Sep 17 00:00:00 2001 From: Steve Gilham Date: Thu, 1 Dec 2022 20:39:41 +0100 Subject: [PATCH 1/3] non-release branch CI < => -pre artifacts --- .github/workflows/main.yml | 2 +- Build/targets.fs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fb951a6..6c67152 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ on: - master env: - VERSIONTEMPLATE: 5.23.0.{build}-pre + VERSIONTEMPLATE: 5.23.0.{build} DOTNET_ROLL_FORWARD : LatestMajor jobs: diff --git a/Build/targets.fs b/Build/targets.fs index 0e365b6..9e2b407 100644 --- a/Build/targets.fs +++ b/Build/targets.fs @@ -256,12 +256,13 @@ module Targets = Environment.environVar "GITHUB_RUN_NUMBER" let now = DateTimeOffset.UtcNow + let trailer = if currentBranch.StartsWith "release/" then String.Empty else "-pre" let version = - if currentBranch.Contains "VsWhat" then + (if currentBranch.Contains "VsWhat" then sprintf "%d.%d.%d.{build}" (now.Year - 2000) now.Month now.Day - else - Actions.GetVersionFromYaml() + else + Actions.GetVersionFromYaml()) + trailer printfn "Raw version %s" version From 1e9e6d3a9ad9fa1caf91bffa10cf5ff5840a1b2b Mon Sep 17 00:00:00 2001 From: Steve Gilham Date: Sun, 4 Dec 2022 19:35:16 +0100 Subject: [PATCH 2/3] Improve release UX --- .fantomasignore | 4 ++- AltCode.Fake.sln | 1 - Build/AltCode.Fake.nuspec | 1 + Build/README.Fake.md | 11 ++++++++ Build/README.What.md | 7 +++++ Build/actions.fs | 11 +++++--- Build/targets.fs | 56 ++++++++++++++++++++++++++++----------- README.md | 19 +++++++------ 8 files changed, 80 insertions(+), 30 deletions(-) create mode 100644 Build/README.Fake.md create mode 100644 Build/README.What.md diff --git a/.fantomasignore b/.fantomasignore index 01a3035..fa80a98 100644 --- a/.fantomasignore +++ b/.fantomasignore @@ -1,3 +1,5 @@ # Ignore interfaces (documentation annotations) *.fsi -Abstract.fs \ No newline at end of file +Abstract.fs +*.AssemblyAttributes.fs +*/_Generated/*.fs \ No newline at end of file diff --git a/AltCode.Fake.sln b/AltCode.Fake.sln index 92dc177..a53da41 100644 --- a/AltCode.Fake.sln +++ b/AltCode.Fake.sln @@ -9,7 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BuildItems", "BuildItems", ProjectSection(SolutionItems) = preProject Build\actions.fsx = Build\actions.fsx Build\AltCode.Fake.nuspec = Build\AltCode.Fake.nuspec - appveyor.yml = appveyor.yml Build\build.fsx = Build\build.fsx Directory.Build.props = Directory.Build.props Directory.Build.targets = Directory.Build.targets diff --git a/Build/AltCode.Fake.nuspec b/Build/AltCode.Fake.nuspec index 18b56f7..df7aedb 100644 --- a/Build/AltCode.Fake.nuspec +++ b/Build/AltCode.Fake.nuspec @@ -15,6 +15,7 @@ false @description@ @releaseNotes@ + Nonesuch.md @copyright@ FAKE build @dependencies@ diff --git a/Build/README.Fake.md b/Build/README.Fake.md new file mode 100644 index 0000000..16c8972 --- /dev/null +++ b/Build/README.Fake.md @@ -0,0 +1,11 @@ + +# AltCode.Fake.DotNet.Gendarme + +A Gendarme helper along the lines of the FxCop task `Fake.DotNet.FxCop` +For FAKE >= 5.23.0 or later. + +Can be used with the most recent [homebrew release from my fork](https://www.nuget.org/packages/altcode.gendarme/) to analyze netcore/netstandard builds. + +## Usage + +See the [Wiki page](https://github.com/SteveGilham/altcode.fake/wiki/The-AltCode.Fake.DotNet.Gendarme-package) for details diff --git a/Build/README.What.md b/Build/README.What.md new file mode 100644 index 0000000..96e4b43 --- /dev/null +++ b/Build/README.What.md @@ -0,0 +1,7 @@ +# AltCode.VsWhat + +A tool to list Visual Studio instances and their installed packages; a thin wrapper over [BlackFox.VsWhere](https://github.com/vbfox/FoxSharp/blob/master/src/BlackFox.VsWhere/Readme.md) to make this one specific query. + +## Usage + +See the [Wiki page](https://github.com/SteveGilham/altcode.fake/wiki/The-AltCode.VsWhat-package) for details diff --git a/Build/actions.fs b/Build/actions.fs index ecaccbc..49d704f 100644 --- a/Build/actions.fs +++ b/Build/actions.fs @@ -246,8 +246,8 @@ do ()""" let RunDotnet (o: DotNet.Options -> DotNet.Options) cmd args msg = DotNet.exec o cmd args |> (HandleResults msg) - let PrepareReadMe packingCopyright = - let readme = Path.getFullName "README.md" + let PrepareReadMe packingCopyright file = + let readme = Path.getFullName file let document = File.ReadAllText readme let markdown = Markdown() @@ -312,6 +312,11 @@ a:hover {color: #ecc;} | _ -> ()) let packable = - Path.getFullName "./_Binaries/README.html" + Path.getFullName ( + file + .Replace("Build", "_Binaries") + .Replace("md", "html") + ) + printfn "packable %A" packable xmlform.Save packable \ No newline at end of file diff --git a/Build/targets.fs b/Build/targets.fs index 9e2b407..b4d53ce 100644 --- a/Build/targets.fs +++ b/Build/targets.fs @@ -240,8 +240,20 @@ module Targets = printfn "Build at %A" infoV let _Target s f = + let doTarget s f = + let banner x = + printfn "" + printfn " ****************** %s ******************" s + f x + + Target.create s banner + Target.description s - Target.create s f + doTarget s f + + let s2 = "Replay" + s + Target.description s2 + doTarget s2 f // Preparation @@ -256,13 +268,19 @@ module Targets = Environment.environVar "GITHUB_RUN_NUMBER" let now = DateTimeOffset.UtcNow - let trailer = if currentBranch.StartsWith "release/" then String.Empty else "-pre" + + let trailer = + if currentBranch.StartsWith "release/" then + String.Empty + else + "-pre" let version = (if currentBranch.Contains "VsWhat" then - sprintf "%d.%d.%d.{build}" (now.Year - 2000) now.Month now.Day + sprintf "%d.%d.%d.{build}" (now.Year - 2000) now.Month now.Day else - Actions.GetVersionFromYaml()) + trailer + Actions.GetVersionFromYaml()) + + trailer printfn "Raw version %s" version @@ -697,13 +715,11 @@ module Targets = let gendarmeDir = Path.getFullName "_Binaries/AltCode.Fake.DotNet.Gendarme/Release+AnyCPU" - let packable = - Path.getFullName "./_Binaries/README.html" - let gendarmeFiles = [ (Path.getFullName "./LICENS*", Some "", None) (Path.getFullName "./Build/AltCode.Fake_128.*g", Some "", None) - (packable, Some "", None) ] + (Path.getFullName "./Build/README.Fake.md", Some "", None) + (Path.getFullName "./_Binaries/README.Fake.html", Some "", None) ] let gendarmeNetcoreFiles = (!!(gendarmeDir @@ -731,7 +747,8 @@ module Targets = let whatPack = [ (Path.getFullName "./LICENS*", Some "", None) (Path.getFullName "./Build/AltCode.VsWhat_128.*g", Some "", None) - (packable, Some "", None) ] + (Path.getFullName "./Build/README.What.md", Some "", None) + (Path.getFullName "./_Binaries/README.What.html", Some "", None) ] [ (List.concat [ gendarmeFiles; gendarmeNetcoreFiles ], packageGendarme, @@ -802,19 +819,24 @@ module Targets = "./_Generated/altcode.fake.dotnet.gendarme.nuspec", "AltCode.Fake.DotNet.Gendarme (FAKE task helper)", None, - Some "FAKE build Gendarme") + Some "FAKE build Gendarme", + "README.Fake.md") ("DotnetTool", "./_Generated/altcode.vswhat.nuspec", "AltCode.VsWhat (Visual Studio package listing tool)", Some "Build/AltCode.VsWhat_128.png", - Some "Visual Studio") ] - |> List.iter (fun (ptype, path, caption, icon, tags) -> + Some "Visual Studio", + "README.What.md") ] + |> List.iter (fun (ptype, path, caption, icon, tags, readme) -> let x s = XName.Get(s, "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd") let dotnetNupkg = XDocument.Load "./Build/AltCode.Fake.nuspec" + dotnetNupkg.Descendants(x "readme") + |> Seq.iter (fun hint -> hint.SetValue readme) + let title = dotnetNupkg.Descendants(x "title") |> Seq.head @@ -858,12 +880,16 @@ module Targets = let PrepareReadMe = (fun _ -> - Actions.PrepareReadMe( - (Copyright.Value) + let c = + Copyright + .Value .Replace("©", "©") .Replace("<", "<") .Replace(">", ">") - )) + + [ "./Build/README.Fake.md" + "./Build/README.What.md" ] + |> Seq.iter (Actions.PrepareReadMe c)) // Post-packaging deployment touch test diff --git a/README.md b/README.md index 1d39bf3..bc0eda2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ FAKE helper code that I've written as a side-effect of other projects ## What's in the box? -For FAKE >= 5.19.1 or later for .net framework and .net core +For FAKE >= 5.23.0 or later for .net core * [`AltCode.Fake.DotNet.Gendarme` ![Nuget](https://buildstats.info/nuget/AltCode.Fake.DotNet.Gendarme)](http://nuget.org/packages/altcode.fake.dotnet.gendarme), a gendarme helper along the lines of the FxCop task `Fake.DotNet.FxCop` @@ -17,9 +17,9 @@ DotNet global tools ## Continuous Integration -| | | | -| --- | --- | --- | -| **Build** | GitHub [![Build status](https://github.com/SteveGilham/altcode.fake/workflows/CI/badge.svg)](https://github.com/SteveGilham/altcover/altcode.fake?query=workflow%3ACI)[![Build history](https://buildstats.info/github/chart/SteveGilham/altcode.fake?branch=master)](https://github.com/SteveGilham/altcode.fake/actions?query=workflow%3ACI)| AppVeyor [![Build status](https://img.shields.io/appveyor/ci/SteveGilham/altcode-fake/master.svg)](https://ci.appveyor.com/project/SteveGilham/altcode-fake) ![Build history](https://buildstats.info/appveyor/chart/SteveGilham/altcode-fake?branch=master) | +| | | +| --- | --- | +| **Build** | GitHub [![Build status](https://github.com/SteveGilham/altcode.fake/workflows/CI/badge.svg)](https://github.com/SteveGilham/altcover/altcode.fake?query=workflow%3ACI)[![Build history](https://buildstats.info/github/chart/SteveGilham/altcode.fake?branch=master)](https://github.com/SteveGilham/altcode.fake/actions?query=workflow%3ACI)| | **Unit Test coverage** | Coveralls [![Coverage Status](https://coveralls.io/repos/github/SteveGilham/altcode.fake/badge.svg?branch=master)](https://coveralls.io/github/SteveGilham/altcode.fake?branch=master) | ## Usage @@ -35,7 +35,7 @@ See the [Wiki page](https://github.com/SteveGilham/altcode.fake/wiki) for detail It is assumed that the following are available -.net core SDK 5.0.100 or later (`dotnet`) -- try https://www.microsoft.com/net/download +.net core SDK 7.0.100 or later (`dotnet`) -- try https://www.microsoft.com/net/download #### Windows @@ -47,17 +47,16 @@ It is assumed that the latest `mono`, and `dotnet` are on the `PATH` already, an ### Bootstrapping -Start by setting up `dotnet fake` with `dotnet tool restore` -Then `dotnet fake run ./Build/setup.fsx` to do the rest of the set-up. +Start by setting up `required tools with `dotnet tool restore` +Then `dotnet run --project ./Build/Setup.fsproj` to do the rest of the set-up. ### Normal builds -Running `dotnet fake run ./Build/build.fsx` performs a full build/test/package process. +Running `dotnet run --project ./Build/Build.fsproj` performs a full build/test/package process. -Use `dotnet fake run ./Build/build.fsx --target ` to run to a specific target. +Use `dotnet run --project ./Build/Build.fsproj --target ` to run to a specific target. ## Thanks to -* [AppVeyor](https://ci.appveyor.com/project/SteveGilham/altcode-fake) for allowing free build CI services for Open Source projects * [Coveralls](https://coveralls.io/r/SteveGilham/altcode.fake) for allowing free services for Open Source projects From 54868afb990b56a26e912c1926591731fd8e9d67 Mon Sep 17 00:00:00 2001 From: Steve Gilham Date: Sun, 4 Dec 2022 19:58:38 +0100 Subject: [PATCH 3/3] Update release notes again --- ReleaseNotes.VsWhat.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReleaseNotes.VsWhat.md b/ReleaseNotes.VsWhat.md index be8e7c3..1727715 100644 --- a/ReleaseNotes.VsWhat.md +++ b/ReleaseNotes.VsWhat.md @@ -1,5 +1,5 @@ -# 22.12.4.40 -* No functional change; testing new release bundling +# 22.12.4.41 +* No functional change since 22.12.1.38; testing new release bundling # 22.12.1.38 * Support for .net7.0