Add table generator to the installer repo so it can be found and updated along with the tables.
This commit is contained in:
parent
dcc8aac7af
commit
668d2efb0e
10 changed files with 1066 additions and 1 deletions
47
tools/sdk-readme-table-generator/TableGenerator/Program.fs
Normal file
47
tools/sdk-readme-table-generator/TableGenerator/Program.fs
Normal file
|
@ -0,0 +1,47 @@
|
|||
module TableGenerator.App
|
||||
|
||||
open System
|
||||
open TableGenerator.Shared
|
||||
open TableGenerator.Reference
|
||||
open TableGenerator.Table
|
||||
|
||||
let inputBranches =
|
||||
[ { GitBranchName = "master"
|
||||
DisplayName = "Master<br>(6.0.x Runtime)"
|
||||
AkaMsChannel = Some("net6/dev") }
|
||||
{ GitBranchName = "release/5.0.2xx"
|
||||
DisplayName = "Release/5.0.2XX<br>(5.0 Runtime)"
|
||||
AkaMsChannel = Some("net5/5.0.2xx/daily") }
|
||||
{ GitBranchName = "release/5.0.1xx-rtm"
|
||||
DisplayName = "5.0.100 RTM<br>(5.0 Runtime)"
|
||||
AkaMsChannel = Some("net5/5.0.1xx/daily") }
|
||||
{ GitBranchName = "release/3.1.4xx"
|
||||
DisplayName = "Release/3.1.4XX<br>(3.1.x Runtime)"
|
||||
AkaMsChannel = None }
|
||||
{ GitBranchName = "release/3.1.1xx"
|
||||
DisplayName = "Release/3.1.1XX<br>(3.1.x Runtime)"
|
||||
AkaMsChannel = None }]
|
||||
|
||||
|
||||
let referentNotes = """Reference notes:
|
||||
> **1**: Our Debian packages are put together slightly differently than the other OS specific installers. Instead of combining everything, we have separate component packages that depend on each other. If you're installing the SDK from the .deb file (via dpkg or similar), then you'll need to install the corresponding dependencies first:
|
||||
> * [Host, Host FX Resolver, and Shared Framework](https://github.com/dotnet/runtime#daily-builds)
|
||||
> * [ASP.NET Core Shared Framework](https://github.com/aspnet/AspNetCore/blob/master/docs/DailyBuilds.md)
|
||||
|
||||
.NET Core SDK 2.x downloads can be found here: [.NET Core SDK 2.x Installers and Binaries](Downloads2.x.md)"""
|
||||
|
||||
let sdksha2 =
|
||||
"[sdk-shas-2.2.1XX]: https://github.com/dotnet/versions/tree/master/build-info/dotnet/product/cli/release/2.2#built-repositories"
|
||||
|
||||
let wholeTable branches =
|
||||
String.Join
|
||||
(Environment.NewLine + Environment.NewLine,
|
||||
[ table branches
|
||||
referentNotes
|
||||
referenceList branches
|
||||
sdksha2 ])
|
||||
|
||||
[<EntryPoint>]
|
||||
let main argv =
|
||||
Console.WriteLine(wholeTable inputBranches)
|
||||
0
|
202
tools/sdk-readme-table-generator/TableGenerator/Reference.fs
Normal file
202
tools/sdk-readme-table-generator/TableGenerator/Reference.fs
Normal file
|
@ -0,0 +1,202 @@
|
|||
module TableGenerator.Reference
|
||||
|
||||
open System
|
||||
open TableGenerator.Shared
|
||||
|
||||
let referenceTemplate: ReferenceTemplate = {
|
||||
LegacyTemplate = """[{0}-badge-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/{3}_Release_version_badge.svg
|
||||
[{0}-version-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/latest.version
|
||||
[{0}-installer-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.exe
|
||||
[{0}-installer-checksum-{1}]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.exe.sha
|
||||
[{0}-zip-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.zip
|
||||
[{0}-zip-checksum-{1}]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.zip.sha"""
|
||||
|
||||
AkaMSTemplate = """[{0}-badge-{1}]: https://aka.ms/dotnet/{4}/Sdk/{3}_Release_version_badge.svg
|
||||
[{0}-version-{1}]: https://aka.ms/dotnet/{4}/Sdk/productCommit-{0}.txt
|
||||
[{0}-installer-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.exe
|
||||
[{0}-installer-checksum-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.exe.sha
|
||||
[{0}-zip-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.zip
|
||||
[{0}-zip-checksum-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.zip.sha"""
|
||||
}
|
||||
|
||||
let targzReferenceTemplate: ReferenceTemplate = {
|
||||
LegacyTemplate = """[{0}-badge-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/{3}_Release_version_badge.svg
|
||||
[{0}-version-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/latest.version
|
||||
[{0}-targz-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.tar.gz
|
||||
[{0}-targz-checksum-{1}]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.tar.gz.sha"""
|
||||
|
||||
AkaMSTemplate = """[{0}-badge-{1}]: https://aka.ms/dotnet/{4}/Sdk/{3}_Release_version_badge.svg
|
||||
[{0}-version-{1}]: https://aka.ms/dotnet/{4}/Sdk/productCommit-{0}.txt
|
||||
[{0}-targz-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.tar.gz
|
||||
[{0}-targz-checksum-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.tar.gz.sha""" }
|
||||
|
||||
let linuxArmNoArchitectureReferenceTemplate: ReferenceTemplate = {
|
||||
LegacyTemplate = """[{0}-badge-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/{3}_Release_version_badge.svg
|
||||
[{0}-version-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/latest.version
|
||||
[{0}-targz-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.tar.gz
|
||||
[{0}-targz-checksum-{1}]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.tar.gz.sha"""
|
||||
|
||||
AkaMSTemplate = """[{0}-badge-{1}]: https://aka.ms/dotnet/{4}/Sdk/{3}_Release_version_badge.svg
|
||||
[{0}-version-{1}]: https://aka.ms/dotnet/{4}/Sdk/productCommit-{0}.txt
|
||||
[{0}-targz-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.tar.gz
|
||||
[{0}-targz-checksum-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.tar.gz.sha""" }
|
||||
|
||||
let osxReferenceTemplate: ReferenceTemplate = {
|
||||
LegacyTemplate = """[{0}-badge-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/{3}_Release_version_badge.svg
|
||||
[{0}-version-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/latest.version
|
||||
[{0}-installer-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.pkg
|
||||
[{0}-installer-checksum-{1}]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.pkg.sha
|
||||
[{0}-targz-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.tar.gz
|
||||
[{0}-targz-checksum-{1}]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.tar.gz.sha"""
|
||||
|
||||
AkaMSTemplate = """[{0}-badge-{1}]: https://aka.ms/dotnet/{4}/Sdk/{3}_Release_version_badge.svg
|
||||
[{0}-version-{1}]: https://aka.ms/dotnet/{4}/Sdk/productCommit-{0}.txt
|
||||
[{0}-installer-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.pkg
|
||||
[{0}-installer-checksum-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.pkg.sha
|
||||
[{0}-targz-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.tar.gz
|
||||
[{0}-targz-checksum-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.pkg.tar.gz.sha"""
|
||||
}
|
||||
|
||||
let linuxReferenceTemplate: ReferenceTemplate = {
|
||||
LegacyTemplate = """[linux-badge-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/{3}_Release_version_badge.svg
|
||||
[linux-version-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/latest.version
|
||||
[linux-DEB-installer-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-x64.deb
|
||||
[linux-DEB-installer-checksum-{1}]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-x64.deb.sha
|
||||
[linux-RPM-installer-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-x64.rpm
|
||||
[linux-RPM-installer-checksum-{1}]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-x64.rpm.sha
|
||||
[linux-targz-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.tar.gz
|
||||
[linux-targz-checksum-{1}]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.tar.gz.sha"""
|
||||
|
||||
AkaMSTemplate = """[linux-badge-{1}]: https://aka.ms/dotnet/{4}/Sdk/{3}_Release_version_badge.svg
|
||||
[linux-version-{1}]: https://aka.ms/dotnet/{4}/Sdk/productCommit-{0}.txt
|
||||
[linux-DEB-installer-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-x64.deb
|
||||
[linux-DEB-installer-checksum-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-x64.deb.sha
|
||||
[linux-RPM-installer-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-x64.rpm
|
||||
[linux-RPM-installer-checksum-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-x64.rpm.sha
|
||||
[linux-targz-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.tar.gz
|
||||
[linux-targz-checksum-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.tar.gz.sha"""
|
||||
}
|
||||
|
||||
let rhel6ReferenceTemplate: ReferenceTemplate = {
|
||||
LegacyTemplate = """[rhel-6-badge-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/{3}_Release_version_badge.svg
|
||||
[rhel-6-version-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/latest.version
|
||||
[rhel-6-targz-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.tar.gz
|
||||
[rhel-6-targz-checksum-{1}]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.tar.gz.sha"""
|
||||
|
||||
AkaMSTemplate = """[rhel-6-badge-{1}]: https://aka.ms/dotnet/{4}/Sdk/{3}_Release_version_badge.svg
|
||||
[rhel-6-version-{1}]: https://aka.ms/dotnet/{4}/Sdk/productCommit-{0}.txt
|
||||
[rhel-6-targz-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.tar.gz
|
||||
[rhel-6-targz-checksum-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.tar.gz.sha"""
|
||||
}
|
||||
|
||||
let linuxMuslReferenceTemplate: ReferenceTemplate = {
|
||||
LegacyTemplate = """[{0}-badge-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/{3}_Release_version_badge.svg
|
||||
[{0}-version-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/latest.version
|
||||
[{0}-targz-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.tar.gz
|
||||
[{0}-targz-checksum-{1}]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.tar.gz.sha"""
|
||||
|
||||
AkaMSTemplate = """[{0}-badge-{1}]: https://aka.ms/dotnet/{4}/Sdk/{3}_Release_version_badge.svg
|
||||
[{0}-version-{1}]: https://aka.ms/dotnet/{4}/Sdk/productCommit-{0}.txt
|
||||
[{0}-targz-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.tar.gz
|
||||
[{0}-targz-checksum-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.tar.gz.sha"""
|
||||
}
|
||||
|
||||
let winMuslReferenceTemplate: ReferenceTemplate = {
|
||||
LegacyTemplate = """[{0}-badge-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/{3}_Release_version_badge.svg
|
||||
[{0}-version-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/latest.version
|
||||
[{0}-zip-{1}]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.zip
|
||||
[{0}-zip-checksum-{1}]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/{2}/dotnet-sdk-latest-{0}.zip.sha"""
|
||||
|
||||
AkaMSTemplate = """[{0}-badge-{1}]: https://aka.ms/dotnet/{4}/Sdk/{3}_Release_version_badge.svg
|
||||
[{0}-version-{1}]: https://aka.ms/dotnet/{4}/Sdk/productCommit-{0}.txt
|
||||
[{0}-zip-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.zip
|
||||
[{0}-zip-checksum-{1}]: https://aka.ms/dotnet/{4}/Sdk/dotnet-sdk-{0}.zip.sha"""
|
||||
}
|
||||
|
||||
let formatTemplate (platform: String) (template: ReferenceTemplate) (branch: Branch): Option<string> =
|
||||
if branch.AkaMsChannel <> None then
|
||||
Some (String.Format(template.AkaMSTemplate,
|
||||
platform, // 0 - win-x64
|
||||
(branchNameShorten branch), // 1 - 5.0.1xx-preview2
|
||||
branch.GitBranchName, // 2 - 5.0.100-preview.2.20169.1
|
||||
(platform.Replace('-', '_')), // 3 - win_64
|
||||
branch.AkaMsChannel.Value)) // 4 - 5.0/preview2
|
||||
else
|
||||
Some (String.Format(template.LegacyTemplate,
|
||||
platform, // 0 - win-64
|
||||
(branchNameShorten branch), // 1 - 5.0.1xx-preview2
|
||||
branch.GitBranchName, // 2 - 5.0.100-preview.2.20169.1
|
||||
(platform.Replace('-', '_')))) // 3 - win_64
|
||||
|
||||
let winX64ReferenceTemplate = formatTemplate "win-x64" referenceTemplate
|
||||
|
||||
let winX86ReferenceTemplate = formatTemplate "win-x86" referenceTemplate
|
||||
|
||||
let osxX64ReferenceTemplate = formatTemplate "osx-x64" osxReferenceTemplate
|
||||
|
||||
let osxArm64ReferenceTemplate branch =
|
||||
let format branch = formatTemplate "osx-arm64" osxReferenceTemplate branch
|
||||
match getMajorMinor branch with
|
||||
| Master -> format branch
|
||||
| MajorMinor { Major = major; Minor = _minor } when major >= 6 -> format branch
|
||||
| _ -> None
|
||||
|
||||
let linuxX64ReferenceTemplate = formatTemplate "linux-x64" linuxReferenceTemplate
|
||||
|
||||
let linuxArmReferenceTemplate = formatTemplate "linux-arm" linuxArmNoArchitectureReferenceTemplate
|
||||
|
||||
let linuxArm64ReferenceTemplate = formatTemplate "linux-arm64" linuxArmNoArchitectureReferenceTemplate
|
||||
|
||||
let rhel6x64ReferenceTemplate = formatTemplate "rhel.6-x64" rhel6ReferenceTemplate
|
||||
|
||||
let linuxMuslx64ReferenceTemplate = formatTemplate "linux-musl-x64" linuxMuslReferenceTemplate
|
||||
|
||||
let linuxMuslArmReferenceTemplate branch =
|
||||
let format branch = formatTemplate "linux-musl-arm" linuxMuslReferenceTemplate branch
|
||||
match getMajorMinor branch with
|
||||
| Master -> format branch
|
||||
| MajorMinor { Major = major; Minor = _minor } when major >= 6 -> format branch
|
||||
| _ -> None
|
||||
|
||||
let linuxMuslArm64ReferenceTemplate branch =
|
||||
let format branch = formatTemplate "linux-musl-arm64" linuxMuslReferenceTemplate branch
|
||||
match getMajorMinor branch with
|
||||
| Master -> format branch
|
||||
| MajorMinor { Major = major; Minor = _minor } when major >= 6 -> format branch
|
||||
| _ -> None
|
||||
|
||||
let winArmMuslReferenceTemplate branch =
|
||||
match getMajorMinor branch with
|
||||
| NoVersion -> None
|
||||
| MajorMinor { Major = major; Minor = minor } when major <= 2 && minor <= 1 -> None
|
||||
| _ -> formatTemplate "win-arm" winMuslReferenceTemplate branch
|
||||
|
||||
let winArm64MuslReferenceTemplate branch =
|
||||
match getMajorMinor branch with
|
||||
| NoVersion -> None
|
||||
| MajorMinor { Major = major; Minor = minor } when major < 5 -> None
|
||||
| _ -> formatTemplate "win-arm64" referenceTemplate branch
|
||||
|
||||
let templates =
|
||||
[ winX64ReferenceTemplate
|
||||
winX86ReferenceTemplate
|
||||
osxX64ReferenceTemplate
|
||||
osxArm64ReferenceTemplate
|
||||
linuxX64ReferenceTemplate
|
||||
linuxArmReferenceTemplate
|
||||
linuxArm64ReferenceTemplate
|
||||
rhel6x64ReferenceTemplate
|
||||
linuxMuslx64ReferenceTemplate
|
||||
linuxMuslArmReferenceTemplate
|
||||
linuxMuslArm64ReferenceTemplate
|
||||
winArmMuslReferenceTemplate
|
||||
winArm64MuslReferenceTemplate ]
|
||||
|
||||
let referenceList branches =
|
||||
String.Join
|
||||
(Environment.NewLine + Environment.NewLine,
|
||||
templates
|
||||
|> List.collect (fun template ->
|
||||
branches
|
||||
|> List.map template
|
||||
|> List.choose id))
|
42
tools/sdk-readme-table-generator/TableGenerator/Shared.fs
Normal file
42
tools/sdk-readme-table-generator/TableGenerator/Shared.fs
Normal file
|
@ -0,0 +1,42 @@
|
|||
module TableGenerator.Shared
|
||||
|
||||
open NuGet.Versioning
|
||||
open System
|
||||
|
||||
type Branch =
|
||||
{ GitBranchName: string
|
||||
DisplayName: string
|
||||
AkaMsChannel: string option }
|
||||
|
||||
type ReferenceTemplate =
|
||||
{ AkaMSTemplate: string
|
||||
LegacyTemplate: string }
|
||||
|
||||
let branchNameShorten (branch: Branch): string =
|
||||
branch.GitBranchName.Substring(branch.GitBranchName.IndexOf('/') + 1).Replace("xx", "XX")
|
||||
|
||||
type BranchMajorMinorVersion =
|
||||
{ Major: int
|
||||
Minor: int
|
||||
Release: string}
|
||||
|
||||
type BranchMajorMinorVersionOrMaster =
|
||||
| Master
|
||||
| MajorMinor of BranchMajorMinorVersion
|
||||
| NoVersion
|
||||
|
||||
let getMajorMinor (branch: Branch): BranchMajorMinorVersionOrMaster =
|
||||
match branch.GitBranchName = "master" with
|
||||
| true -> Master
|
||||
| _ ->
|
||||
match branch.GitBranchName.IndexOf('/') with
|
||||
| index when index < 0 -> NoVersion
|
||||
| _ ->
|
||||
match NuGetVersion.TryParseStrict
|
||||
(branch.GitBranchName.Substring(branch.GitBranchName.IndexOf('/') + 1).Replace("xx", "99")) with
|
||||
| true, version ->
|
||||
MajorMinor
|
||||
{ Major = version.Major
|
||||
Minor = version.Minor
|
||||
Release = version.Release}
|
||||
| _ -> NoVersion
|
144
tools/sdk-readme-table-generator/TableGenerator/Table.fs
Normal file
144
tools/sdk-readme-table-generator/TableGenerator/Table.fs
Normal file
|
@ -0,0 +1,144 @@
|
|||
module TableGenerator.Table
|
||||
|
||||
open System
|
||||
open TableGenerator.Shared
|
||||
|
||||
let notAvailable = "**N/A**"
|
||||
|
||||
let windowsDesktopArchTableTemplate =
|
||||
"""[![][{0}-badge-{1}]][{0}-version-{1}]<br>[Installer][{0}-installer-{1}] - [Checksum][{0}-installer-checksum-{1}]<br>[zip][{0}-zip-{1}] - [Checksum][{0}-zip-checksum-{1}]"""
|
||||
|
||||
let linuxArmTableTemplate =
|
||||
"[![][{0}-badge-{1}]][{0}-version-{1}]<br>[tar.gz][{0}-targz-{1}] - [Checksum][{0}-targz-checksum-{1}]"
|
||||
|
||||
let osxDesktopArchTableTemplate =
|
||||
"""[![][{0}-badge-{1}]][{0}-version-{1}]<br>[Installer][{0}-installer-{1}] - [Checksum][{0}-installer-checksum-{1}]<br>[tar.gz][{0}-targz-{1}] - [Checksum][{0}-targz-checksum-{1}]"""
|
||||
|
||||
let joinListOfArchs (listOfArchs: List<string>): string = "| " + String.Join(" | ", listOfArchs) + " |"
|
||||
|
||||
let formRow rowTitle tableTemplateForThisArch branches =
|
||||
let inList =
|
||||
List.concat
|
||||
[ [ rowTitle ]
|
||||
(branches |> List.map tableTemplateForThisArch) ]
|
||||
joinListOfArchs inList
|
||||
|
||||
let windowsX64Row branches =
|
||||
let tableTemplateForThisArch branch =
|
||||
String.Format(windowsDesktopArchTableTemplate, "win-x64", branchNameShorten branch)
|
||||
formRow "**Windows x64**" tableTemplateForThisArch branches
|
||||
|
||||
let windowsX86Row branches =
|
||||
let tableTemplateForThisArch branch =
|
||||
String.Format(windowsDesktopArchTableTemplate, "win-x86", branchNameShorten branch)
|
||||
formRow "**Windows x86**" tableTemplateForThisArch branches
|
||||
|
||||
let osxX64Row branches =
|
||||
let tableTemplateForThisArch branch = String.Format(osxDesktopArchTableTemplate, "osx-x64", branchNameShorten branch)
|
||||
formRow "**macOS x64**" tableTemplateForThisArch branches
|
||||
|
||||
let osxArm64Row branches =
|
||||
let format branch = String.Format(osxDesktopArchTableTemplate, "osx-arm64", branchNameShorten branch)
|
||||
let tableTemplateForThisArch branch =
|
||||
match getMajorMinor branch with
|
||||
| Master -> format branch
|
||||
| MajorMinor { Major = major; Minor = _minor } when major >= 6 -> format branch
|
||||
| _ -> notAvailable
|
||||
formRow "**macOS arm64**" tableTemplateForThisArch branches
|
||||
|
||||
let linuxDesktopArchRow branches =
|
||||
let tableTemplate =
|
||||
"""[![][linux-badge-{0}]][linux-version-{0}]<br>[DEB Installer][linux-DEB-installer-{0}] - [Checksum][linux-DEB-installer-checksum-{0}]<br>[RPM Installer][linux-RPM-installer-{0}] - [Checksum][linux-RPM-installer-checksum-{0}]<br>_see installer note below_<sup>1</sup><br>[tar.gz][linux-targz-{0}] - [Checksum][linux-targz-checksum-{0}]"""
|
||||
let tableTemplateForThisArch branch = String.Format(tableTemplate, branchNameShorten branch)
|
||||
formRow "**Linux x64**" tableTemplateForThisArch branches
|
||||
|
||||
let linuxArmRow branches =
|
||||
let tableTemplateForThisArch branch = String.Format(linuxArmTableTemplate, "linux-arm", branchNameShorten branch)
|
||||
formRow "**Linux arm**" tableTemplateForThisArch branches
|
||||
|
||||
let linuxArm64Row branches =
|
||||
let tableTemplateForThisArch branch = String.Format(linuxArmTableTemplate, "linux-arm64", branchNameShorten branch)
|
||||
formRow "**Linux arm64**" tableTemplateForThisArch branches
|
||||
|
||||
let rhel6Row branches =
|
||||
let tableTemplateForThisArch branch =
|
||||
match getMajorMinor branch with
|
||||
| NoVersion -> notAvailable
|
||||
| Master -> notAvailable
|
||||
| MajorMinor { Major = major; Minor = minor } when major >= 5 -> notAvailable
|
||||
| _ -> String.Format(linuxArmTableTemplate, "rhel-6", branchNameShorten branch)
|
||||
formRow "**RHEL 6**" tableTemplateForThisArch branches
|
||||
|
||||
let linuxMuslRowX64 branches =
|
||||
let format branch = String.Format(linuxArmTableTemplate, "linux-musl-x64", branchNameShorten branch)
|
||||
let tableTemplateForThisArch branch = format branch
|
||||
formRow "**Linux-musl-x64**" tableTemplateForThisArch branches
|
||||
|
||||
let linuxMuslRowArm branches =
|
||||
let format branch = String.Format(linuxArmTableTemplate, "linux-musl-arm", branchNameShorten branch)
|
||||
let tableTemplateForThisArch branch =
|
||||
match getMajorMinor branch with
|
||||
| Master -> format branch
|
||||
| MajorMinor { Major = major; Minor = _minor } when major >= 6 -> format branch
|
||||
| _ -> notAvailable
|
||||
formRow "**Linux-musl-arm**" tableTemplateForThisArch branches
|
||||
|
||||
let linuxMuslRowArm64 branches =
|
||||
let format branch = String.Format(linuxArmTableTemplate, "linux-musl-arm64", branchNameShorten branch)
|
||||
let tableTemplateForThisArch branch =
|
||||
match getMajorMinor branch with
|
||||
| Master -> format branch
|
||||
| MajorMinor { Major = major; Minor = _minor } when major >= 6 -> format branch
|
||||
| _ -> notAvailable
|
||||
formRow "**Linux-musl-arm64**" tableTemplateForThisArch branches
|
||||
|
||||
let windowsArmRow branches =
|
||||
let tableTemplate =
|
||||
"[![][win-arm-badge-{0}]][win-arm-version-{0}]<br>[zip][win-arm-zip-{0}] - [Checksum][win-arm-zip-checksum-{0}]"
|
||||
|
||||
let tableTemplateForThisArch branch =
|
||||
match getMajorMinor branch with
|
||||
| NoVersion -> notAvailable
|
||||
| Master -> notAvailable
|
||||
| MajorMinor { Major = major; Minor = minor } when ( major >= 5) -> notAvailable
|
||||
| _ -> String.Format(tableTemplate, branchNameShorten branch)
|
||||
formRow "**Windows arm**" tableTemplateForThisArch branches
|
||||
|
||||
let windowsArm64Row branches =
|
||||
let tableTemplate =
|
||||
"[![][win-arm64-badge-{0}]][win-arm64-version-{0}]<br>[zip][win-arm64-zip-{0}]"
|
||||
|
||||
let tableInstallerTemplate =
|
||||
"""[![][win-arm64-badge-{0}]][win-arm64-version-{0}]<br>[Installer][win-arm64-installer-{0}] - [Checksum][win-arm64-installer-checksum-{0}]<br>[zip][win-arm64-zip-{0}]"""
|
||||
|
||||
let tableTemplateForThisArch branch =
|
||||
match getMajorMinor branch with
|
||||
| NoVersion -> notAvailable
|
||||
| MajorMinor { Major = major; Minor = minor; Release = release; } when major <= 3 -> notAvailable
|
||||
| MajorMinor { Major = major; Minor = minor; Release = release; } when major = 5 -> String.Format(tableInstallerTemplate, branchNameShorten branch)
|
||||
| _ -> String.Format(tableTemplate, branchNameShorten branch)
|
||||
formRow "**Windows arm64**" tableTemplateForThisArch branches
|
||||
|
||||
let titleRow = formRow "Platform" (fun (b: Branch) -> b.DisplayName)
|
||||
|
||||
let separator = formRow ":---------" (fun _ -> ":----------:")
|
||||
|
||||
let rows =
|
||||
[ titleRow
|
||||
separator
|
||||
windowsX64Row
|
||||
windowsX86Row
|
||||
windowsArmRow
|
||||
windowsArm64Row
|
||||
linuxDesktopArchRow
|
||||
linuxArmRow
|
||||
linuxArm64Row
|
||||
linuxMuslRowX64
|
||||
linuxMuslRowArm
|
||||
linuxMuslRowArm64
|
||||
rhel6Row
|
||||
osxX64Row
|
||||
osxArm64Row
|
||||
]
|
||||
|
||||
let table branches = String.Join(Environment.NewLine, rows |> List.map (fun row -> row branches))
|
|
@ -0,0 +1,19 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Shared.fs" />
|
||||
<Compile Include="Table.fs" />
|
||||
<Compile Include="Reference.fs" />
|
||||
<Compile Include="Program.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NuGet.Versioning" Version="5.5.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
Loading…
Add table
Add a link
Reference in a new issue