From 1a008157c6ee3a0e20e160b56045a5f0126eb00c Mon Sep 17 00:00:00 2001 From: Jon Canning Date: Sun, 8 Dec 2019 15:56:08 +0000 Subject: [PATCH 01/12] Update to 3.1 --- global.json | 2 +- .../GiraffeRazorSample.fsproj | 6 +---- samples/GiraffeRazorSample/Program.fs | 5 ++-- src/Giraffe.Razor/Giraffe.Razor.fsproj | 18 +++++++------- src/Giraffe.Razor/Middleware.fs | 24 +++++++++++++++---- 5 files changed, 33 insertions(+), 22 deletions(-) diff --git a/global.json b/global.json index be85bb7..09fb065 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "projects": [ "src", "tests" ], "sdk": { - "version": "2.2.105" + "version": "3.1.100" } } \ No newline at end of file diff --git a/samples/GiraffeRazorSample/GiraffeRazorSample.fsproj b/samples/GiraffeRazorSample/GiraffeRazorSample.fsproj index 1613c2d..243ab1b 100644 --- a/samples/GiraffeRazorSample/GiraffeRazorSample.fsproj +++ b/samples/GiraffeRazorSample/GiraffeRazorSample.fsproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + netcoreapp3.1 portable GiraffeRazorSample Exe @@ -10,10 +10,6 @@ $(MSBuildThisFileDirectory) - - - - diff --git a/samples/GiraffeRazorSample/Program.fs b/samples/GiraffeRazorSample/Program.fs index 61d487e..b33bc38 100644 --- a/samples/GiraffeRazorSample/Program.fs +++ b/samples/GiraffeRazorSample/Program.fs @@ -37,7 +37,7 @@ type CreatePerson = // --------------------------------- let antiforgeryTokenHandler = - text "Bad antiforgery token" + text "Bad antiforgery token" |> RequestErrors.badRequest |> validateAntiforgeryToken @@ -146,7 +146,8 @@ let configureApp (app : IApplicationBuilder) = let configureServices (services : IServiceCollection) = let sp = services.BuildServiceProvider() - let env = sp.GetService() + let env = sp.GetService() + services.AddGiraffe() |> ignore Path.Combine(env.ContentRootPath, "Views") |> services.AddRazorEngine |> ignore diff --git a/src/Giraffe.Razor/Giraffe.Razor.fsproj b/src/Giraffe.Razor/Giraffe.Razor.fsproj index af594ca..f511074 100755 --- a/src/Giraffe.Razor/Giraffe.Razor.fsproj +++ b/src/Giraffe.Razor/Giraffe.Razor.fsproj @@ -9,7 +9,7 @@ en-GB - netstandard2.0;net461 + netstandard2.0;net461;netcoreapp3.1 portable Library true @@ -35,14 +35,14 @@ FS2003 - - - - - - - - + + + + + + + + diff --git a/src/Giraffe.Razor/Middleware.fs b/src/Giraffe.Razor/Middleware.fs index 59cc473..5e95a5f 100644 --- a/src/Giraffe.Razor/Middleware.fs +++ b/src/Giraffe.Razor/Middleware.fs @@ -3,20 +3,34 @@ namespace Giraffe.Razor [] module Middleware = +#if NETCOREAPP3_1 + open Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation +#else open Microsoft.AspNetCore.Mvc.Razor +#endif open Microsoft.Extensions.DependencyInjection open Microsoft.Extensions.FileProviders type IServiceCollection with - member this.AddRazorEngine (viewsFolderPath : string) = - this.Configure( - fun (options : RazorViewEngineOptions) -> + + member this.AddRazorEngine(viewsFolderPath: string) = +#if NETCOREAPP3_1 + this.Configure(fun (options: MvcRazorRuntimeCompilationOptions) -> + options.FileProviders.Clear() + options.FileProviders.Add(new PhysicalFileProvider(viewsFolderPath))).AddMvc().AddRazorRuntimeCompilation() + |> ignore +#else + this.Configure(fun (options : RazorViewEngineOptions) -> options.FileProviders.Clear() - options.FileProviders.Add(new PhysicalFileProvider(viewsFolderPath))) - .AddMvc() + options.FileProviders.Add(new PhysicalFileProvider(viewsFolderPath))).AddMvc() |> ignore +#endif this.AddAntiforgery() member this.AddRazorEngine() = +#if NETCOREAPP3_1 + this.AddMvc().AddRazorRuntimeCompilation() |> ignore +#else this.AddMvc() |> ignore +#endif this.AddAntiforgery() From affa2153c4ec44df2727f05117516891a0033254 Mon Sep 17 00:00:00 2001 From: Christian Folie Date: Thu, 19 Mar 2020 12:52:08 +0100 Subject: [PATCH 02/12] Adds IModelMetadataProvider to RazorEngine metadata-attributes in views could not be used, because they were not populated by a ModelMetadataProvider --- src/Giraffe.Razor/HttpHandlers.fs | 3 ++- src/Giraffe.Razor/RazorEngine.fs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Giraffe.Razor/HttpHandlers.fs b/src/Giraffe.Razor/HttpHandlers.fs index a5f5ec1..bd3c20b 100644 --- a/src/Giraffe.Razor/HttpHandlers.fs +++ b/src/Giraffe.Razor/HttpHandlers.fs @@ -25,9 +25,10 @@ module HttpHandlers = (modelState : ModelStateDictionary option) : HttpHandler = fun (next : HttpFunc) (ctx : HttpContext) -> task { + let metadataProvider = ctx.RequestServices.GetService() let engine = ctx.RequestServices.GetService() let tempDataDict = ctx.RequestServices.GetService().GetTempData ctx - let! result = renderView engine tempDataDict ctx viewName model viewData modelState + let! result = renderView engine metadataProvider tempDataDict ctx viewName model viewData modelState match result with | Error msg -> return (failwith msg) | Ok output -> diff --git a/src/Giraffe.Razor/RazorEngine.fs b/src/Giraffe.Razor/RazorEngine.fs index 18492ce..d3dfc9c 100644 --- a/src/Giraffe.Razor/RazorEngine.fs +++ b/src/Giraffe.Razor/RazorEngine.fs @@ -44,6 +44,7 @@ module RazorEngine = routeData let renderView (razorViewEngine : IRazorViewEngine) + (modelMetadataProvider: IModelMetadataProvider) (tempDataDict : ITempDataDictionary) (httpContext : HttpContext) (viewName : string) @@ -67,7 +68,7 @@ module RazorEngine = let viewModelState = defaultArg modelState (ModelStateDictionary()) let viewDataDict = ViewDataDictionary<'T>( - EmptyModelMetadataProvider(), + modelMetadataProvider, viewModelState, Model = viewModel) if (viewData.IsSome) then From d8148004bd52b1c307e018b3b4c2921fb03b1eab Mon Sep 17 00:00:00 2001 From: Dustin Moris Gorski Date: Mon, 13 Apr 2020 14:12:06 +0100 Subject: [PATCH 03/12] Upped dependencies --- .psscripts/build-functions.ps1 | 92 ++++++++++++++++---------- .psscripts/install-dotnet.ps1 | 46 +++---------- .psscripts/nuget-updates.ps1 | 8 ++- .travis.yml | 22 ------ Giraffe.Razor.sln | 18 +++++ appveyor.yml | 3 +- build.ps1 | 4 +- src/Giraffe.Razor/Giraffe.Razor.fsproj | 8 +-- 8 files changed, 96 insertions(+), 105 deletions(-) delete mode 100644 .travis.yml create mode 100644 Giraffe.Razor.sln diff --git a/.psscripts/build-functions.ps1 b/.psscripts/build-functions.ps1 index c6bc517..8479181 100644 --- a/.psscripts/build-functions.ps1 +++ b/.psscripts/build-functions.ps1 @@ -2,19 +2,6 @@ # Generic functions # ---------------------------------------------- -function Test-IsWindows -{ - <# - .DESCRIPTION - Checks to see whether the current environment is Windows or not. - - .EXAMPLE - if (Test-IsWindows) { Write-Host "Hello Windows" } - #> - - [environment]::OSVersion.Platform -ne "Unix" -} - function Test-IsMonoInstalled { <# @@ -66,7 +53,7 @@ function Invoke-UnsafeCmd ( #> if (!($Silent.IsPresent)) { Write-Host $cmd -ForegroundColor DarkCyan } - if (Test-IsWindows) { $cmd = "cmd.exe /C $cmd" } + if ($IsWindows) { $cmd = "cmd.exe /C $cmd" } Invoke-Expression -Command $cmd } @@ -89,7 +76,11 @@ function Invoke-Cmd ( #> if ($Silent.IsPresent) { Invoke-UnsafeCmd $cmd -Silent } else { Invoke-UnsafeCmd $cmd } - if ($LastExitCode -ne 0) { Write-Error "An error occured when executing '$Cmd'."; return } + if ($LastExitCode -ne 0) { + Write-Host "An error occured when executing '$Cmd'." + Write-Error "An error occured when executing '$Cmd'." + return + } } function Remove-OldBuildArtifacts @@ -151,7 +142,7 @@ function Test-CompareVersions ($version, [string]$gitTag) function Add-ToPathVariable ($path) { - if (Test-IsWindows) + if ($IsWindows) { $updatedPath = "$path;$env:Path" [Environment]::SetEnvironmentVariable("Path", $updatedPath, "Process") @@ -167,6 +158,11 @@ function Add-ToPathVariable ($path) } } +function Get-ProjectName ($proj) +{ + [System.IO.Path]::GetFileNameWithoutExtension($proj) +} + # ---------------------------------------------- # .NET Core functions # ---------------------------------------------- @@ -195,7 +191,7 @@ function Get-TargetFrameworks ($projFile) else { @($proj.Project.PropertyGroup.TargetFramework) } } -function Get-NetCoreTargetFramework ($projFile) +function Get-NetCoreTargetFrameworks ($projFile) { <# .DESCRIPTION @@ -205,7 +201,7 @@ function Get-NetCoreTargetFramework ($projFile) The full or relative path to a .NET Core project file (*.csproj, *.fsproj, *.vbproj). .EXAMPLE - Get-NetCoreTargetFramework "MyProject.csproj" + Get-NetCoreTargetFrameworks "MyProject.csproj" .NOTES This function will always return the only netstandard*/netcoreapp* target framework which is set up as a target framework. @@ -219,13 +215,20 @@ function Invoke-DotNetCli ($cmd, $proj, $argv) # Currently dotnet test does not work for net461 on Linux/Mac # See: https://github.com/Microsoft/vstest/issues/1318 - if((!(Test-IsWindows) -and !(Test-IsMonoInstalled)) ` - -or (!(Test-IsWindows) -and ($cmd -eq "test"))) + if((!($IsWindows) -and !(Test-IsMonoInstalled)) ` + -or (!($IsWindows) -and ($cmd -eq "test"))) + { + $netCoreFrameworks = Get-NetCoreTargetFrameworks($proj) + + foreach($fw in $netCoreFrameworks) { + $fwArgv = "-f $fw " + $argv + Invoke-Cmd "dotnet $cmd $proj $fwArgv" + } + } + else { - $fw = Get-NetCoreTargetFramework($proj) - $argv = "-f $fw " + $argv + Invoke-Cmd "dotnet $cmd $proj $argv" } - Invoke-Cmd "dotnet $cmd $proj $argv" } function dotnet-info { Invoke-Cmd "dotnet --info" -Silent } @@ -290,8 +293,14 @@ function Get-NetCoreSdkFromWeb ($version) Write-Host "Downloading .NET Core SDK $version..." - $os = if (Test-IsWindows) { "windows" } else { "linux" } - $ext = if (Test-IsWindows) { ".zip" } else { ".tar.gz" } + $os = + if ($IsWindows) { "windows" } + elseif ($IsLinux) { "linux" } + elseif ($IsMacOS) { "macos" } + else { Write-Error "Unknown OS, which is not supported by .NET Core." } + + $ext = if ($IsWindows) { ".zip" } else { ".tar.gz" } + $uri = "https://www.microsoft.com/net/download/thank-you/dotnet-sdk-$version-$os-x64-binaries" Write-Host "Finding download link..." @@ -314,7 +323,7 @@ function Get-NetCoreSdkFromWeb ($version) return $tempFile } -function Install-NetCoreSdkFromArchive ($sdkArchivePath) +function Install-NetCoreSdkFromArchive ($sdkPackagePath) { <# .DESCRIPTION @@ -324,21 +333,34 @@ function Install-NetCoreSdkFromArchive ($sdkArchivePath) The zip archive which contains the .NET Core SDK. #> - if (Test-IsWindows) + if ($IsWindows) { $dotnetInstallDir = [System.IO.Path]::Combine($pwd, ".dotnetsdk") - New-Item $dotnetInstallDir -ItemType Directory -Force | Out-Null - Write-Host "Created folder '$dotnetInstallDir'." - Expand-Archive -LiteralPath $sdkArchivePath -DestinationPath $dotnetInstallDir -Force - Write-Host "Extracted '$sdkArchivePath' to folder '$dotnetInstallDir'." + + if (!(Test-Path $dotnetInstallDir)) + { + New-Item $dotnetInstallDir -ItemType Directory -Force | Out-Null + Write-Host "Created folder '$dotnetInstallDir'." + } + + Expand-Archive -LiteralPath $sdkPackagePath -DestinationPath $dotnetInstallDir -Force + Write-Host "Extracted '$sdkPackagePath' to folder '$dotnetInstallDir'." + + [Environment]::SetEnvironmentVariable("DOTNET_ROOT", $dotnetInstallDir, "Process") + Write-Host "DOTNET_ROOT environment variable has been set to $dotnetInstallDir." } else { $dotnetInstallDir = "$env:HOME/.dotnetsdk" - Invoke-Cmd "mkdir -p $dotnetInstallDir" - Write-Host "Created folder '$dotnetInstallDir'." - Invoke-Cmd "tar -xf $sdkArchivePath -C $dotnetInstallDir" - Write-Host "Extracted '$sdkArchivePath' to folder '$dotnetInstallDir'." + + if (!(Test-Path $dotnetInstallDir)) + { + Invoke-Cmd "mkdir -p $dotnetInstallDir" + Write-Host "Created folder '$dotnetInstallDir'." + } + + Invoke-Cmd "tar -xf $sdkPackagePath -C $dotnetInstallDir" + Write-Host "Extracted '$sdkPackagePath' to folder '$dotnetInstallDir'." } Add-ToPathVariable $dotnetInstallDir diff --git a/.psscripts/install-dotnet.ps1 b/.psscripts/install-dotnet.ps1 index c43c50f..f128b2f 100644 --- a/.psscripts/install-dotnet.ps1 +++ b/.psscripts/install-dotnet.ps1 @@ -4,51 +4,23 @@ param ( - [switch] $ForceUbuntuInstall + [string] $SdkVersions ) $ErrorActionPreference = "Stop" Import-module "$PSScriptRoot\build-functions.ps1" -Force -if ($ForceUbuntuInstall.IsPresent) -{ - $desiredSdk = Get-DesiredSdk - $versionParts = $desiredSdk.Split(".") - $majorMinorVer = $versionParts[0] + "." + $versionParts[1] - $ubuntuVersion = Get-UbuntuVersion - - Write-Host "Ubuntu version: $ubuntuVersion" - Install-NetCoreSdkForUbuntu $ubuntuVersion $majorMinorVer - return -} - -# Rename the global.json before making the dotnet --version call -# This will prevent AppVeyor to fail because it might not find -# the desired SDK specified in the global.json -$globalJson = Get-Item "$PSScriptRoot\..\global.json" -Rename-Item -Path $globalJson.FullName -NewName "global.json.bak" -Force - -# Get the current .NET Core SDK version -$currentSdk = dotnet-version +# Get desired SDKs from argument +$desiredSDKs = $SdkVersions.Split(",") | % { $_.Trim() } -# After we established the current installed .NET SDK we can put the global.json back -Rename-Item -Path ($globalJson.FullName + ".bak") -NewName "global.json" -Force - -$desiredSdk = Get-DesiredSdk - -if ($desiredSdk -eq $currentSdk) +foreach($desiredSDK in $desiredSDKs) { - Write-Host "The current .NET SDK matches the project's desired .NET SDK: $desiredSDK" -ForegroundColor Green - return + Write-Host "Attempting to download and install the .NET SDK $desiredSDK..." + $sdkZipPath = Get-NetCoreSdkFromWeb $desiredSDK + Install-NetCoreSdkFromArchive $sdkZipPath } -Write-Host "The current .NET SDK ($currentSdk) doesn't match the project's desired .NET SDK ($desiredSdk)." -ForegroundColor Yellow - -Write-Host "Attempting to download and install the correct .NET SDK..." - -$sdkZipPath = Get-NetCoreSdkFromWeb $desiredSdk -Install-NetCoreSdkFromArchive $sdkZipPath - -Write-Host ".NET SDK installation complete." -ForegroundColor Green +Write-Host ".NET SDK installations complete." -ForegroundColor Green +dotnet-info dotnet-version \ No newline at end of file diff --git a/.psscripts/nuget-updates.ps1 b/.psscripts/nuget-updates.ps1 index c00e69a..0707067 100644 --- a/.psscripts/nuget-updates.ps1 +++ b/.psscripts/nuget-updates.ps1 @@ -6,8 +6,12 @@ function Get-NuGetPackageInfo ($nugetPackageId, $currentVersion) { $url = "https://api-v2v3search-0.nuget.org/query?q=$nugetPackageId&prerelease=false" $result = Invoke-RestMethod -Uri $url -Method Get - $latestVersion = $result.data[0].version - $upgradeAvailable = $currentVersion -and !$latestVersion.StartsWith($currentVersion.Replace("*", "")) + $packageInfo = $result.data | Where-Object { $_.id -eq $nugetPackageId } + $latestVersion = $packageInfo.version + $upgradeAvailable = + $currentVersion ` + -and $latestVersion ` + -and !$latestVersion.StartsWith($currentVersion.Replace("*", "")) [PSCustomObject]@{ PackageName = $nugetPackageId; diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1e96f5f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: csharp -sudo: required -dist: trusty - -dotnet: 2.2.105 -mono: - - 4.6.1 - - 4.8.1 - - 5.18.0 -os: - - linux - -before_install: - - curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - - - curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list - - sudo apt-get update - - sudo apt-get install -y powershell - - sudo pwsh ./.psscripts/install-dotnet.ps1 - -script: - - export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/ - - pwsh ./build.ps1 -Release \ No newline at end of file diff --git a/Giraffe.Razor.sln b/Giraffe.Razor.sln new file mode 100644 index 0000000..2f92ebd --- /dev/null +++ b/Giraffe.Razor.sln @@ -0,0 +1,18 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/appveyor.yml b/appveyor.yml index d264aed..596771e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,8 +7,7 @@ environment: init: - git config --global core.autocrlf true install: - - sh: export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/ - - ps: .\.psscripts\install-dotnet.ps1 + - ps: .\.psscripts\install-dotnet.ps1 -SdkVersions "3.0.100, 2.2.402" build: off build_script: - ps: .\build.ps1 -Release -Pack diff --git a/build.ps1 b/build.ps1 index d03b084..8979ce1 100644 --- a/build.ps1 +++ b/build.ps1 @@ -7,8 +7,7 @@ param [switch] $Release, [switch] $ExcludeSamples, [switch] $Pack, - [switch] $Run, - [switch] $OnlyNetStandard + [switch] $Run ) # ---------------------------------------------- @@ -34,7 +33,6 @@ if (Test-IsAppVeyorBuildTriggeredByGitTag) } Write-DotnetCoreVersions - Remove-OldBuildArtifacts $configuration = if ($Release.IsPresent) { "Release" } else { "Debug" } diff --git a/src/Giraffe.Razor/Giraffe.Razor.fsproj b/src/Giraffe.Razor/Giraffe.Razor.fsproj index af594ca..c9e28af 100755 --- a/src/Giraffe.Razor/Giraffe.Razor.fsproj +++ b/src/Giraffe.Razor/Giraffe.Razor.fsproj @@ -37,12 +37,12 @@ - - - + + + - + From 3c8f5f7193c218ec302951c7b013ffde0482c83d Mon Sep 17 00:00:00 2001 From: Stuart Lang Date: Thu, 25 Jun 2020 22:10:23 +0100 Subject: [PATCH 04/12] Drop support for older TFMs --- global.json | 4 +++- src/Giraffe.Razor/Giraffe.Razor.fsproj | 11 +++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/global.json b/global.json index 09fb065..0c341eb 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,8 @@ { "projects": [ "src", "tests" ], "sdk": { - "version": "3.1.100" + "version": "3.1.100", + "rollForward": "latestMajor", + "allowPrerelease": false } } \ No newline at end of file diff --git a/src/Giraffe.Razor/Giraffe.Razor.fsproj b/src/Giraffe.Razor/Giraffe.Razor.fsproj index f511074..8dab447 100755 --- a/src/Giraffe.Razor/Giraffe.Razor.fsproj +++ b/src/Giraffe.Razor/Giraffe.Razor.fsproj @@ -9,7 +9,7 @@ en-GB - netstandard2.0;net461;netcoreapp3.1 + netcoreapp3.1 portable Library true @@ -35,14 +35,9 @@ FS2003 - - - - - - + + - From aec73ecb1f10d94eb66d5ca4f30c7cf0ce07b826 Mon Sep 17 00:00:00 2001 From: Stuart Lang Date: Thu, 25 Jun 2020 22:19:28 +0100 Subject: [PATCH 05/12] Removed ifdefs --- src/Giraffe.Razor/Middleware.fs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/Giraffe.Razor/Middleware.fs b/src/Giraffe.Razor/Middleware.fs index 5e95a5f..c587e03 100644 --- a/src/Giraffe.Razor/Middleware.fs +++ b/src/Giraffe.Razor/Middleware.fs @@ -3,34 +3,19 @@ namespace Giraffe.Razor [] module Middleware = -#if NETCOREAPP3_1 open Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation -#else - open Microsoft.AspNetCore.Mvc.Razor -#endif open Microsoft.Extensions.DependencyInjection open Microsoft.Extensions.FileProviders type IServiceCollection with member this.AddRazorEngine(viewsFolderPath: string) = -#if NETCOREAPP3_1 this.Configure(fun (options: MvcRazorRuntimeCompilationOptions) -> options.FileProviders.Clear() options.FileProviders.Add(new PhysicalFileProvider(viewsFolderPath))).AddMvc().AddRazorRuntimeCompilation() |> ignore -#else - this.Configure(fun (options : RazorViewEngineOptions) -> - options.FileProviders.Clear() - options.FileProviders.Add(new PhysicalFileProvider(viewsFolderPath))).AddMvc() - |> ignore -#endif this.AddAntiforgery() member this.AddRazorEngine() = -#if NETCOREAPP3_1 this.AddMvc().AddRazorRuntimeCompilation() |> ignore -#else - this.AddMvc() |> ignore -#endif this.AddAntiforgery() From 2bfe7824ac8f99c784181ef6775f26ed716cc033 Mon Sep 17 00:00:00 2001 From: Stuart Lang Date: Thu, 25 Jun 2020 22:27:14 +0100 Subject: [PATCH 06/12] Update appveyor.yml --- appveyor.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d264aed..3b70a36 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,13 +1,12 @@ version: 0.1.0-{build} image: - - Visual Studio 2017 + - Visual Studio 2019 - Ubuntu environment: DOTNET_CLI_TELEMETRY_OPTOUT: 1 init: - git config --global core.autocrlf true install: - - sh: export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/ - ps: .\.psscripts\install-dotnet.ps1 build: off build_script: @@ -26,4 +25,4 @@ deploy: skip_symbols: false artifact: /.*\.nupkg/ on: - appveyor_repo_tag: true \ No newline at end of file + appveyor_repo_tag: true From 1a82b677466330088682ab4de8e216dec9a8af08 Mon Sep 17 00:00:00 2001 From: Dustin Moris Gorski Date: Sat, 27 Jun 2020 00:44:34 +0100 Subject: [PATCH 07/12] Moved to GitHub Actions --- .github/workflows/build.yml | 83 ++++ .psscripts/build-functions.ps1 | 427 ------------------ .psscripts/install-dotnet.ps1 | 26 -- .psscripts/nuget-updates.ps1 | 65 --- CODE_OF_CONDUCT.md | 76 ++++ Giraffe.Razor.sln | 50 ++ appveyor.yml | 28 -- build.ps1 | 62 --- build.sh | 2 - giraffe-64x64.png | Bin 0 -> 3458 bytes global.json | 8 - .../GiraffeRazorSample.fsproj | 2 - src/Giraffe.Razor/Giraffe.Razor.fsproj | 14 +- 13 files changed, 219 insertions(+), 624 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .psscripts/build-functions.ps1 delete mode 100644 .psscripts/install-dotnet.ps1 delete mode 100644 .psscripts/nuget-updates.ps1 create mode 100644 CODE_OF_CONDUCT.md delete mode 100644 appveyor.yml delete mode 100644 build.ps1 delete mode 100755 build.sh create mode 100644 giraffe-64x64.png delete mode 100644 global.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1a33bfe --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,83 @@ +name: .NET Core +on: + push: + pull_request: + release: + types: + - published +env: + PROJECT_PATH: src/Giraffe.Razor/Giraffe.Razor.fsproj + GITHUB_SOURCE: https://nuget.pkg.github.com/giraffe-fsharp/ + GITHUB_USER: dustinmoris + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NUGET_KEY: ${{ secrets.NUGET_KEY }} +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + steps: + - uses: actions/checkout@v2 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.301 + - name: Restore + run: dotnet restore + - name: Build + run: dotnet build --configuration Release --no-restore + - name: Test + run: dotnet test --configuration Release + - name: Pack + if: matrix.os == 'ubuntu-latest' + run: dotnet pack --configuration Release --no-restore --verbosity normal --include-symbols --include-source -p:PackageVersion=$GITHUB_RUN_ID $PROJECT_PATH + - name: Upload Artifact + if: matrix.os == 'ubuntu-latest' + uses: actions/upload-artifact@v2 + with: + name: nupkg + path: ./src/Giraffe.ViewEngine/bin/Release/*.nupkg + prerelease: + needs: build + if: github.ref == 'refs/heads/develop' + runs-on: ubuntu-latest + steps: + - name: Download Artifact + uses: actions/download-artifact@v1 + with: + name: nupkg + - name: Push Pre-Release NuGet + run: | + for f in ./nupkg/*.nupkg + do + curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$f $GITHUB_SOURCE + done + shell: bash + deploy: + needs: build + if: github.event_name == 'release' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.301 + - name: Create Release NuGet package + run: | + arrTag=(${GITHUB_REF//\// }) + VERSION="${arrTag[2]}" + echo Version: $VERSION + VERSION="${VERSION//v}" + echo Clean Version: $VERSION + dotnet pack --configuration Release --verbosity normal --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg $PROJECT_PATH + - name: Push to GitHub Feed + run: | + for f in ./nupkg/*.nupkg + do + curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$f $GITHUB_SOURCE + done + shell: bash + - name: Push to NuGet Feed + run: dotnet nuget push nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key $NUGET_KEY \ No newline at end of file diff --git a/.psscripts/build-functions.ps1 b/.psscripts/build-functions.ps1 deleted file mode 100644 index 8479181..0000000 --- a/.psscripts/build-functions.ps1 +++ /dev/null @@ -1,427 +0,0 @@ -# ---------------------------------------------- -# Generic functions -# ---------------------------------------------- - -function Test-IsMonoInstalled -{ - <# - .DESCRIPTION - Checks to see whether the current environment has the Mono framework installed. - - .EXAMPLE - if (Test-IsMonoInstalled) { Write-Host "Mono is available." } - #> - - try - { - $result = Invoke-Cmd "mono --version" -Silent - return $result.StartsWith("Mono JIT compiler version") - } - catch { return false } -} - -function Get-UbuntuVersion -{ - <# - .DESCRIPTION - Gets the Ubuntu version. - - .EXAMPLE - $ubuntuVersion = Get-UbuntuVersion - #> - - $version = Invoke-Cmd "lsb_release -r -s" -Silent - return $version -} - -function Invoke-UnsafeCmd ( - [string] $Cmd, - [switch] $Silent) -{ - <# - .DESCRIPTION - Runs a shell or bash command, but doesn't throw an error if the command didn't exit with 0. - - .PARAMETER cmd - The command to be executed. - - .EXAMPLE - Invoke-Cmd -Cmd "dotnet new classlib" - - .NOTES - Use this PowerShell command to execute any CLI commands which might not exit with 0 on a success. - #> - - if (!($Silent.IsPresent)) { Write-Host $cmd -ForegroundColor DarkCyan } - if ($IsWindows) { $cmd = "cmd.exe /C $cmd" } - Invoke-Expression -Command $cmd -} - -function Invoke-Cmd ( - [string] $Cmd, - [switch] $Silent) -{ - <# - .DESCRIPTION - Runs a shell or bash command and throws an error if the command didn't exit with 0. - - .PARAMETER cmd - The command to be executed. - - .EXAMPLE - Invoke-Cmd -Cmd "dotnet new classlib" - - .NOTES - Use this PowerShell command to execute any dotnet CLI commands in order to ensure that they behave the same way in the case of an error across different environments (Windows, OSX and Linux). - #> - - if ($Silent.IsPresent) { Invoke-UnsafeCmd $cmd -Silent } else { Invoke-UnsafeCmd $cmd } - if ($LastExitCode -ne 0) { - Write-Host "An error occured when executing '$Cmd'." - Write-Error "An error occured when executing '$Cmd'." - return - } -} - -function Remove-OldBuildArtifacts -{ - <# - .DESCRIPTION - Deletes all the bin and obj folders from the current- and all sub directories. - #> - - Write-Host "Deleting old build artifacts..." -ForegroundColor Magenta - - Get-ChildItem -Include "bin", "obj" -Recurse -Directory ` - | ForEach-Object { - Write-Host "Removing folder $_" -ForegroundColor DarkGray - Remove-Item $_ -Recurse -Force } -} - -function Get-ProjectVersion ($projFile) -{ - <# - .DESCRIPTION - Gets the value of a .NET Core *.csproj, *.fsproj or *.vbproj file. - - .PARAMETER cmd - The relative or absolute path to the .NET Core project file. - #> - - [xml]$xml = Get-Content $projFile - [string] $version = $xml.Project.PropertyGroup.Version - $version -} - -function Get-NuspecVersion ($nuspecFile) -{ - <# - .DESCRIPTION - Gets the value of a .nuspec file. - - .PARAMETER cmd - The relative or absolute path to the .nuspec file. - #> - - [xml] $xml = Get-Content $nuspecFile - [string] $version = $xml.package.metadata.version - $version -} - -function Test-CompareVersions ($version, [string]$gitTag) -{ - Write-Host "Matching version against git tag..." -ForegroundColor Magenta - Write-Host "Project version: $version" -ForegroundColor Cyan - Write-Host "Git tag version: $gitTag" -ForegroundColor Cyan - - if (!$gitTag.EndsWith($version)) - { - Write-Error "Version and Git tag do not match." - } -} - -function Add-ToPathVariable ($path) -{ - if ($IsWindows) - { - $updatedPath = "$path;$env:Path" - [Environment]::SetEnvironmentVariable("Path", $updatedPath, "Process") - [Environment]::SetEnvironmentVariable("Path", $updatedPath, "User") - [Environment]::SetEnvironmentVariable("Path", $updatedPath, "Machine") - } - else - { - $updatedPath = "$path`:$env:PATH" - [Environment]::SetEnvironmentVariable("PATH", $updatedPath, "Process") - [Environment]::SetEnvironmentVariable("PATH", $updatedPath, "User") - [Environment]::SetEnvironmentVariable("PATH", $updatedPath, "Machine") - } -} - -function Get-ProjectName ($proj) -{ - [System.IO.Path]::GetFileNameWithoutExtension($proj) -} - -# ---------------------------------------------- -# .NET Core functions -# ---------------------------------------------- - -function Get-TargetFrameworks ($projFile) -{ - <# - .DESCRIPTION - Returns all target frameworks set up inside a specific .NET Core project file. - - .PARAMETER projFile - The full or relative path to a .NET Core project file (*.csproj, *.fsproj, *.vbproj). - - .EXAMPLE - Get-TargetFrameworks "MyProject.csproj" - - .NOTES - This function will always return an array of target frameworks, even if only a single target framework was found in the project file. - #> - - [xml]$proj = Get-Content $projFile - - if ($null -ne $proj.Project.PropertyGroup.TargetFrameworks) { - ($proj.Project.PropertyGroup.TargetFrameworks).Split(";") - } - else { @($proj.Project.PropertyGroup.TargetFramework) } -} - -function Get-NetCoreTargetFrameworks ($projFile) -{ - <# - .DESCRIPTION - Returns a single .NET Core framework which could be found among all configured target frameworks of a given .NET Core project file. - - .PARAMETER projFile - The full or relative path to a .NET Core project file (*.csproj, *.fsproj, *.vbproj). - - .EXAMPLE - Get-NetCoreTargetFrameworks "MyProject.csproj" - - .NOTES - This function will always return the only netstandard*/netcoreapp* target framework which is set up as a target framework. - #> - - Get-TargetFrameworks $projFile | Where-Object { $_ -like "netstandard*" -or $_ -like "netcoreapp*" } -} - -function Invoke-DotNetCli ($cmd, $proj, $argv) -{ - # Currently dotnet test does not work for net461 on Linux/Mac - # See: https://github.com/Microsoft/vstest/issues/1318 - - if((!($IsWindows) -and !(Test-IsMonoInstalled)) ` - -or (!($IsWindows) -and ($cmd -eq "test"))) - { - $netCoreFrameworks = Get-NetCoreTargetFrameworks($proj) - - foreach($fw in $netCoreFrameworks) { - $fwArgv = "-f $fw " + $argv - Invoke-Cmd "dotnet $cmd $proj $fwArgv" - } - } - else - { - Invoke-Cmd "dotnet $cmd $proj $argv" - } -} - -function dotnet-info { Invoke-Cmd "dotnet --info" -Silent } -function dotnet-version { Invoke-Cmd "dotnet --version" -Silent } -function dotnet-restore ($project, $argv) { Invoke-Cmd "dotnet restore $project $argv" } -function dotnet-build ($project, $argv) { Invoke-DotNetCli -Cmd "build" -Proj $project -Argv $argv } -function dotnet-test ($project, $argv) { Invoke-DotNetCli -Cmd "test" -Proj $project -Argv $argv } -function dotnet-run ($project, $argv) { Invoke-Cmd "dotnet run --project $project $argv" } -function dotnet-pack ($project, $argv) { Invoke-Cmd "dotnet pack $project $argv" } -function dotnet-publish ($project, $argv) { Invoke-Cmd "dotnet publish $project $argv" } - -function Get-DotNetRuntimeVersion -{ - <# - .DESCRIPTION - Runs the dotnet --info command and extracts the .NET Core Runtime version number. - - .NOTES - The .NET Core Runtime version can sometimes be useful for other dotnet CLI commands (e.g. dotnet xunit -fxversion ".NET Core Runtime version"). - #> - - $info = dotnet-info - [System.Array]::Reverse($info) - $version = $info | Where-Object { $_.Contains("Version") } | Select-Object -First 1 - $version.Split(":")[1].Trim() -} - -function Write-DotnetCoreVersions -{ - <# - .DESCRIPTION - Writes the .NET Core SDK and Runtime version to the current host. - #> - - $sdkVersion = dotnet-version - $runtimeVersion = Get-DotNetRuntimeVersion - Write-Host ".NET Core SDK version: $sdkVersion" -ForegroundColor Cyan - Write-Host ".NET Core Runtime version: $runtimeVersion" -ForegroundColor Cyan -} - -function Get-DesiredSdk -{ - <# - .DESCRIPTION - Gets the desired .NET Core SDK version from the global.json file. - #> - - Get-Content "global.json" ` - | ConvertFrom-Json ` - | ForEach-Object { $_.sdk.version.ToString() } -} - -function Get-NetCoreSdkFromWeb ($version) -{ - <# - .DESCRIPTION - Downloads the desired .NET Core SDK version from the internet and saves it under a temporary file name which will be returned by the function. - - .PARAMETER version - The SDK version which should be downloaded. - #> - - Write-Host "Downloading .NET Core SDK $version..." - - $os = - if ($IsWindows) { "windows" } - elseif ($IsLinux) { "linux" } - elseif ($IsMacOS) { "macos" } - else { Write-Error "Unknown OS, which is not supported by .NET Core." } - - $ext = if ($IsWindows) { ".zip" } else { ".tar.gz" } - - $uri = "https://www.microsoft.com/net/download/thank-you/dotnet-sdk-$version-$os-x64-binaries" - Write-Host "Finding download link..." - - $response = Invoke-WebRequest -Uri $uri - - $downloadLink = - $response.Links ` - | Where-Object { $_.onclick -eq "recordManualDownload()" } ` - | Select-Object -Expand href - - Write-Host "Creating temporary file..." - - $tempFile = [System.IO.Path]::GetTempFileName() + $ext - - $webClient = New-Object System.Net.WebClient - $webClient.DownloadFile($downloadLink, $tempFile) - - Write-Host "Download finished. SDK has been saved to '$tempFile'." - - return $tempFile -} - -function Install-NetCoreSdkFromArchive ($sdkPackagePath) -{ - <# - .DESCRIPTION - Extracts the zip archive which contains the .NET Core SDK and installs it in the current working directory under .dotnetsdk. - - .PARAMETER version - The zip archive which contains the .NET Core SDK. - #> - - if ($IsWindows) - { - $dotnetInstallDir = [System.IO.Path]::Combine($pwd, ".dotnetsdk") - - if (!(Test-Path $dotnetInstallDir)) - { - New-Item $dotnetInstallDir -ItemType Directory -Force | Out-Null - Write-Host "Created folder '$dotnetInstallDir'." - } - - Expand-Archive -LiteralPath $sdkPackagePath -DestinationPath $dotnetInstallDir -Force - Write-Host "Extracted '$sdkPackagePath' to folder '$dotnetInstallDir'." - - [Environment]::SetEnvironmentVariable("DOTNET_ROOT", $dotnetInstallDir, "Process") - Write-Host "DOTNET_ROOT environment variable has been set to $dotnetInstallDir." - } - else - { - $dotnetInstallDir = "$env:HOME/.dotnetsdk" - - if (!(Test-Path $dotnetInstallDir)) - { - Invoke-Cmd "mkdir -p $dotnetInstallDir" - Write-Host "Created folder '$dotnetInstallDir'." - } - - Invoke-Cmd "tar -xf $sdkPackagePath -C $dotnetInstallDir" - Write-Host "Extracted '$sdkPackagePath' to folder '$dotnetInstallDir'." - } - - Add-ToPathVariable $dotnetInstallDir - Write-Host "Added '$dotnetInstallDir' to the PATH environment variable:" - Write-Host $env:PATH -} - -function Install-NetCoreSdkForUbuntu ($ubuntuVersion, $sdkVersion) -{ - Invoke-Cmd "wget -q https://packages.microsoft.com/config/ubuntu/$ubuntuVersion/packages-microsoft-prod.deb" - Invoke-Cmd "sudo dpkg -i packages-microsoft-prod.deb" - Invoke-Cmd "sudo apt-get install apt-transport-https" - Invoke-Cmd "sudo apt-get update" - Invoke-Cmd "sudo apt-get -y install dotnet-sdk-$sdkVersion" -} - -# ---------------------------------------------- -# AppVeyor functions -# ---------------------------------------------- - -function Test-IsAppVeyorBuild { return ($env:APPVEYOR -eq $true) } -function Test-IsAppVeyorBuildTriggeredByGitTag { return ($env:APPVEYOR_REPO_TAG -eq $true) } -function Get-AppVeyorGitTag { return $env:APPVEYOR_REPO_TAG_NAME } - -function Update-AppVeyorBuildVersion ($version) -{ - if (Test-IsAppVeyorBuild) - { - Write-Host "Updating AppVeyor build version..." -ForegroundColor Magenta - $buildVersion = "$version-$env:APPVEYOR_BUILD_NUMBER" - Write-Host "Setting AppVeyor build version to $buildVersion." - Update-AppveyorBuild -Version $buildVersion - } -} - -# ---------------------------------------------- -# Host Writing functions -# ---------------------------------------------- - -function Write-BuildHeader ($projectTitle) -{ - $header = " $projectTitle "; - $bar = "" - for ($i = 0; $i -lt $header.Length; $i++) { $bar += "-" } - - Write-Host "" - Write-Host $bar -ForegroundColor DarkYellow - Write-Host $header -ForegroundColor DarkYellow - Write-Host $bar -ForegroundColor DarkYellow - Write-Host "" -} - -function Write-SuccessFooter ($msg) -{ - $footer = " $msg "; - $bar = "" - for ($i = 0; $i -lt $footer.Length; $i++) { $bar += "-" } - - Write-Host "" - Write-Host $bar -ForegroundColor Green - Write-Host $footer -ForegroundColor Green - Write-Host $bar -ForegroundColor Green - Write-Host "" -} \ No newline at end of file diff --git a/.psscripts/install-dotnet.ps1 b/.psscripts/install-dotnet.ps1 deleted file mode 100644 index f128b2f..0000000 --- a/.psscripts/install-dotnet.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -# ---------------------------------------------- -# Install .NET Core SDK -# ---------------------------------------------- - -param -( - [string] $SdkVersions -) - -$ErrorActionPreference = "Stop" - -Import-module "$PSScriptRoot\build-functions.ps1" -Force - -# Get desired SDKs from argument -$desiredSDKs = $SdkVersions.Split(",") | % { $_.Trim() } - -foreach($desiredSDK in $desiredSDKs) -{ - Write-Host "Attempting to download and install the .NET SDK $desiredSDK..." - $sdkZipPath = Get-NetCoreSdkFromWeb $desiredSDK - Install-NetCoreSdkFromArchive $sdkZipPath -} - -Write-Host ".NET SDK installations complete." -ForegroundColor Green -dotnet-info -dotnet-version \ No newline at end of file diff --git a/.psscripts/nuget-updates.ps1 b/.psscripts/nuget-updates.ps1 deleted file mode 100644 index 0707067..0000000 --- a/.psscripts/nuget-updates.ps1 +++ /dev/null @@ -1,65 +0,0 @@ -# ---------------------------------------------- -# Helper script to find NuGet package upgrades -# ---------------------------------------------- - -function Get-NuGetPackageInfo ($nugetPackageId, $currentVersion) -{ - $url = "https://api-v2v3search-0.nuget.org/query?q=$nugetPackageId&prerelease=false" - $result = Invoke-RestMethod -Uri $url -Method Get - $packageInfo = $result.data | Where-Object { $_.id -eq $nugetPackageId } - $latestVersion = $packageInfo.version - $upgradeAvailable = - $currentVersion ` - -and $latestVersion ` - -and !$latestVersion.StartsWith($currentVersion.Replace("*", "")) - - [PSCustomObject]@{ - PackageName = $nugetPackageId; - Current = $currentVersion; - Latest = $latestVersion; - UpgradeAvailable = $upgradeAvailable - } -} - -filter Highlight-Upgrades -{ - $lines = $_.Split([Environment]::NewLine) - foreach ($line in $lines) { - if ($line.Trim().EndsWith("True")) { - Write-Host $line -ForegroundColor DarkGreen - } else { - Write-Host $line -ForegroundColor Gray - } - } -} - -Write-Host "" -Write-Host "" -Write-Host "--------------------------------------------------" -ForegroundColor DarkYellow -Write-Host " Scanning all projects for NuGet package upgrades " -ForegroundColor DarkYellow -Write-Host "--------------------------------------------------" -ForegroundColor DarkYellow -Write-Host "" - -$projects = Get-ChildItem "$PSScriptRoot\..\**\*.*proj" -Recurse | % { $_.FullName } - -foreach ($project in $projects) -{ - $projName = Split-Path $project -Leaf - Write-Host $projName -ForegroundColor Magenta - - [xml]$proj = Get-Content $project - $references = $proj.Project.ItemGroup.PackageReference | Where-Object { $_.Include -ne $null } - $packages = @() - - foreach ($reference in $references) - { - $id = $reference.Include - $version = $reference.Version - $packages += Get-NuGetPackageInfo $id $version - } - - $packages ` - | Format-Table -Property PackageName, Current, Latest, UpgradeAvailable -AutoSize ` - | Out-String ` - | Highlight-Upgrades -} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..d2ecab7 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at giraffe@dusted.codes. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/Giraffe.Razor.sln b/Giraffe.Razor.sln index 2f92ebd..077aa62 100644 --- a/Giraffe.Razor.sln +++ b/Giraffe.Razor.sln @@ -3,6 +3,26 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26124.0 MinimumVisualStudioVersion = 15.0.26124.0 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{03CCBA43-B6F5-4FA7-8C18-432BB07225FC}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Giraffe.Razor", "src\Giraffe.Razor\Giraffe.Razor.fsproj", "{9B52367B-CC80-452E-9062-7583995BFAC0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{E067A6B8-538E-4362-83C2-9ECBC486AC31}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GiraffeRazorSample", "samples\GiraffeRazorSample\GiraffeRazorSample.fsproj", "{14818084-9969-4F42-8A66-394FC6670B50}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_root", "_root", "{73E09F74-F64D-4C42-92FC-19731C0C5553}" +ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore + .gitattributes = .gitattributes + LICENSE = LICENSE + NuGet.config = NuGet.config + README.md = README.md + RELEASE_NOTES.md = RELEASE_NOTES.md + giraffe-64x64.png = giraffe-64x64.png + CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md +EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,4 +35,34 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {9B52367B-CC80-452E-9062-7583995BFAC0} = {03CCBA43-B6F5-4FA7-8C18-432BB07225FC} + {14818084-9969-4F42-8A66-394FC6670B50} = {E067A6B8-538E-4362-83C2-9ECBC486AC31} + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9B52367B-CC80-452E-9062-7583995BFAC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9B52367B-CC80-452E-9062-7583995BFAC0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9B52367B-CC80-452E-9062-7583995BFAC0}.Debug|x64.ActiveCfg = Debug|Any CPU + {9B52367B-CC80-452E-9062-7583995BFAC0}.Debug|x64.Build.0 = Debug|Any CPU + {9B52367B-CC80-452E-9062-7583995BFAC0}.Debug|x86.ActiveCfg = Debug|Any CPU + {9B52367B-CC80-452E-9062-7583995BFAC0}.Debug|x86.Build.0 = Debug|Any CPU + {9B52367B-CC80-452E-9062-7583995BFAC0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9B52367B-CC80-452E-9062-7583995BFAC0}.Release|Any CPU.Build.0 = Release|Any CPU + {9B52367B-CC80-452E-9062-7583995BFAC0}.Release|x64.ActiveCfg = Release|Any CPU + {9B52367B-CC80-452E-9062-7583995BFAC0}.Release|x64.Build.0 = Release|Any CPU + {9B52367B-CC80-452E-9062-7583995BFAC0}.Release|x86.ActiveCfg = Release|Any CPU + {9B52367B-CC80-452E-9062-7583995BFAC0}.Release|x86.Build.0 = Release|Any CPU + {14818084-9969-4F42-8A66-394FC6670B50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14818084-9969-4F42-8A66-394FC6670B50}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14818084-9969-4F42-8A66-394FC6670B50}.Debug|x64.ActiveCfg = Debug|Any CPU + {14818084-9969-4F42-8A66-394FC6670B50}.Debug|x64.Build.0 = Debug|Any CPU + {14818084-9969-4F42-8A66-394FC6670B50}.Debug|x86.ActiveCfg = Debug|Any CPU + {14818084-9969-4F42-8A66-394FC6670B50}.Debug|x86.Build.0 = Debug|Any CPU + {14818084-9969-4F42-8A66-394FC6670B50}.Release|Any CPU.ActiveCfg = Release|Any CPU + {14818084-9969-4F42-8A66-394FC6670B50}.Release|Any CPU.Build.0 = Release|Any CPU + {14818084-9969-4F42-8A66-394FC6670B50}.Release|x64.ActiveCfg = Release|Any CPU + {14818084-9969-4F42-8A66-394FC6670B50}.Release|x64.Build.0 = Release|Any CPU + {14818084-9969-4F42-8A66-394FC6670B50}.Release|x86.ActiveCfg = Release|Any CPU + {14818084-9969-4F42-8A66-394FC6670B50}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection EndGlobal diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 3b70a36..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 0.1.0-{build} -image: - - Visual Studio 2019 - - Ubuntu -environment: - DOTNET_CLI_TELEMETRY_OPTOUT: 1 -init: - - git config --global core.autocrlf true -install: - - ps: .\.psscripts\install-dotnet.ps1 -build: off -build_script: - - ps: .\build.ps1 -Release -Pack -test: off -artifacts: - - path: '**\Giraffe.*.nupkg' - name: Giraffe NuGet packages -nuget: - account_feed: false - project_feed: true -deploy: - provider: NuGet - api_key: - secure: +XDgIu4Tmln7LKedNmQgMFnyKTxxuCKFRK3V5oKEfwZiakPXRd5C7OueEGBL50oh - skip_symbols: false - artifact: /.*\.nupkg/ - on: - appveyor_repo_tag: true diff --git a/build.ps1 b/build.ps1 deleted file mode 100644 index 8979ce1..0000000 --- a/build.ps1 +++ /dev/null @@ -1,62 +0,0 @@ -# ---------------------------------------------- -# Build script -# ---------------------------------------------- - -param -( - [switch] $Release, - [switch] $ExcludeSamples, - [switch] $Pack, - [switch] $Run -) - -# ---------------------------------------------- -# Main -# ---------------------------------------------- - -$ErrorActionPreference = "Stop" - -Import-module "$PSScriptRoot/.psscripts/build-functions.ps1" -Force - -Write-BuildHeader "Starting Giraffe.Razor build script" - -$giraffeRazor = "./src/Giraffe.Razor/Giraffe.Razor.fsproj" -$sampleApp = "./samples/GiraffeRazorSample/GiraffeRazorSample.fsproj" - -$version = Get-ProjectVersion $giraffeRazor -Update-AppVeyorBuildVersion $version - -if (Test-IsAppVeyorBuildTriggeredByGitTag) -{ - $gitTag = Get-AppVeyorGitTag - Test-CompareVersions $version $gitTag -} - -Write-DotnetCoreVersions -Remove-OldBuildArtifacts - -$configuration = if ($Release.IsPresent) { "Release" } else { "Debug" } - -Write-Host "Building Giraffe.Razor..." -ForegroundColor Magenta -dotnet-build $giraffeRazor "-c $configuration" - -if (!$ExcludeSamples.IsPresent -and !$Run.IsPresent) -{ - Write-Host "Building and testing samples..." -ForegroundColor Magenta - dotnet-build $sampleApp -} - -if ($Run.IsPresent) -{ - Write-Host "Launching sample application..." -ForegroundColor Magenta - dotnet-build $sampleApp - dotnet-run $sampleApp -} - -if ($Pack.IsPresent) -{ - Write-Host "Packaging all NuGet packages..." -ForegroundColor Magenta - dotnet-pack $giraffeRazor "-c $configuration" -} - -Write-SuccessFooter "Giraffe.Razor build completed successfully!" \ No newline at end of file diff --git a/build.sh b/build.sh deleted file mode 100755 index b8e46ef..0000000 --- a/build.sh +++ /dev/null @@ -1,2 +0,0 @@ -export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/ -pwsh ./build.ps1 \ No newline at end of file diff --git a/giraffe-64x64.png b/giraffe-64x64.png new file mode 100644 index 0000000000000000000000000000000000000000..40ed5e37601fefeef919f90b0b50075d0a983d2d GIT binary patch literal 3458 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 WRmVPIj7$G~op5G$*!t7>YySb$DMuUt literal 0 HcmV?d00001 diff --git a/global.json b/global.json deleted file mode 100644 index 0c341eb..0000000 --- a/global.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "projects": [ "src", "tests" ], - "sdk": { - "version": "3.1.100", - "rollForward": "latestMajor", - "allowPrerelease": false - } -} \ No newline at end of file diff --git a/samples/GiraffeRazorSample/GiraffeRazorSample.fsproj b/samples/GiraffeRazorSample/GiraffeRazorSample.fsproj index 243ab1b..e2c5ad8 100644 --- a/samples/GiraffeRazorSample/GiraffeRazorSample.fsproj +++ b/samples/GiraffeRazorSample/GiraffeRazorSample.fsproj @@ -2,9 +2,7 @@ netcoreapp3.1 - portable GiraffeRazorSample - Exe GiraffeRazorSample false $(MSBuildThisFileDirectory) diff --git a/src/Giraffe.Razor/Giraffe.Razor.fsproj b/src/Giraffe.Razor/Giraffe.Razor.fsproj index 8dab447..557c5ac 100755 --- a/src/Giraffe.Razor/Giraffe.Razor.fsproj +++ b/src/Giraffe.Razor/Giraffe.Razor.fsproj @@ -2,9 +2,8 @@ Giraffe.Razor - 4.0.0 Razor view engine support for the Giraffe web framework. - Copyright 2018 Dustin Moris Gorski + Copyright 2020 Dustin Moris Gorski Dustin Moris Gorski and contributors en-GB @@ -21,9 +20,9 @@ Giraffe.Razor Giraffe;Razor;ASP.NET Core;Lambda;FSharp;Functional;Http;Web;Framework;Micro;Service https://raw.githubusercontent.com/giraffe-fsharp/Giraffe.Razor/master/RELEASE_NOTES.md - https://raw.githubusercontent.com/giraffe-fsharp/Giraffe/master/giraffe-64x64.png + giraffe-64x64.png https://github.com/giraffe-fsharp/Giraffe.Razor - https://raw.githubusercontent.com/giraffe-fsharp/Giraffe.Razor/master/LICENSE + Apache-2.0 true git https://github.com/giraffe-fsharp/Giraffe.Razor @@ -35,6 +34,13 @@ FS2003 + + + true + $(PackageIconUrl) + + + From 4f485a82421e3cc3d22295c738ba27df88dfa820 Mon Sep 17 00:00:00 2001 From: Dustin Moris Gorski Date: Sat, 27 Jun 2020 00:53:26 +0100 Subject: [PATCH 08/12] Fixing build --- .github/workflows/build.yml | 7 ++++--- RELEASE_NOTES.md | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a33bfe..a113237 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,7 @@ on: types: - published env: + PROJECT_NAME: Giraffe.Razor PROJECT_PATH: src/Giraffe.Razor/Giraffe.Razor.fsproj GITHUB_SOURCE: https://nuget.pkg.github.com/giraffe-fsharp/ GITHUB_USER: dustinmoris @@ -31,13 +32,13 @@ jobs: run: dotnet test --configuration Release - name: Pack if: matrix.os == 'ubuntu-latest' - run: dotnet pack --configuration Release --no-restore --verbosity normal --include-symbols --include-source -p:PackageVersion=$GITHUB_RUN_ID $PROJECT_PATH + run: dotnet pack --configuration Release --no-restore --verbosity normal --include-symbols --include-source -p:PackageVersion=$GITHUB_RUN_ID src/$PROJECT_NAME/$PROJECT_NAME - name: Upload Artifact if: matrix.os == 'ubuntu-latest' uses: actions/upload-artifact@v2 with: name: nupkg - path: ./src/Giraffe.ViewEngine/bin/Release/*.nupkg + path: ./src/$PROJECT_NAME/bin/Release/*.nupkg prerelease: needs: build if: github.ref == 'refs/heads/develop' @@ -71,7 +72,7 @@ jobs: echo Version: $VERSION VERSION="${VERSION//v}" echo Clean Version: $VERSION - dotnet pack --configuration Release --verbosity normal --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg $PROJECT_PATH + dotnet pack --configuration Release --verbosity normal --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg src/$PROJECT_NAME/$PROJECT_NAME - name: Push to GitHub Feed run: | for f in ./nupkg/*.nupkg diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 9d814bf..5ee9ba4 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,6 +1,11 @@ Release Notes ============= +## 5.0.0 + +- Dropped support for all .NET framework monikers except .NET Core 3.1 (in preparation for the .NET 5 release) +- Added support for `IModelMetadataProvider` + ## 4.0.0 #### Breaking changes & Bug fixes From ea2cec0fa81c05cf3e2c4d405246c00450a1e76b Mon Sep 17 00:00:00 2001 From: Dustin Moris Gorski Date: Sat, 27 Jun 2020 00:56:51 +0100 Subject: [PATCH 09/12] Fixed build --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a113237..7ed1312 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,6 @@ on: - published env: PROJECT_NAME: Giraffe.Razor - PROJECT_PATH: src/Giraffe.Razor/Giraffe.Razor.fsproj GITHUB_SOURCE: https://nuget.pkg.github.com/giraffe-fsharp/ GITHUB_USER: dustinmoris GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -32,7 +31,7 @@ jobs: run: dotnet test --configuration Release - name: Pack if: matrix.os == 'ubuntu-latest' - run: dotnet pack --configuration Release --no-restore --verbosity normal --include-symbols --include-source -p:PackageVersion=$GITHUB_RUN_ID src/$PROJECT_NAME/$PROJECT_NAME + run: dotnet pack --configuration Release --no-restore --verbosity normal --include-symbols --include-source -p:PackageVersion=$GITHUB_RUN_ID src/$PROJECT_NAME/$PROJECT_NAME.*proj - name: Upload Artifact if: matrix.os == 'ubuntu-latest' uses: actions/upload-artifact@v2 @@ -72,7 +71,7 @@ jobs: echo Version: $VERSION VERSION="${VERSION//v}" echo Clean Version: $VERSION - dotnet pack --configuration Release --verbosity normal --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg src/$PROJECT_NAME/$PROJECT_NAME + dotnet pack --configuration Release --verbosity normal --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg src/$PROJECT_NAME/$PROJECT_NAME.*proj - name: Push to GitHub Feed run: | for f in ./nupkg/*.nupkg From cfa6a3cba710c9db639f0030c91071f291e52fd7 Mon Sep 17 00:00:00 2001 From: Dustin Moris Gorski Date: Sat, 27 Jun 2020 01:07:49 +0100 Subject: [PATCH 10/12] Another build fix :( --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7ed1312..e47ffc9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: nupkg - path: ./src/$PROJECT_NAME/bin/Release/*.nupkg + path: ./src/*/bin/Release/*.nupkg prerelease: needs: build if: github.ref == 'refs/heads/develop' From 1cc8586976328f76bff3803fd2e09005688aa850 Mon Sep 17 00:00:00 2001 From: Dustin Moris Gorski Date: Sat, 27 Jun 2020 01:40:02 +0100 Subject: [PATCH 11/12] Updated README --- README.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 359f298..93629da 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,11 @@ Razor view engine support for the [Giraffe](https://github.com/giraffe-fsharp/Gi [![NuGet Info](https://buildstats.info/nuget/Giraffe.Razor?includePreReleases=true)](https://www.nuget.org/packages/Giraffe.Razor/) -### Windows and Linux Builds +### Linux, macOS and Windows Build Status -[![Windows Build status](https://ci.appveyor.com/api/projects/status/914030ec0lrc0vti/branch/develop?svg=true)](https://ci.appveyor.com/project/dustinmoris/giraffe-razor/branch/develop) +![.NET Core](https://github.com/giraffe-fsharp/Giraffe.Razor/workflows/.NET%20Core/badge.svg?branch=develop) -[![Windows Build history](https://buildstats.info/appveyor/chart/dustinmoris/giraffe-razor?branch=develop&includeBuildsFromPullRequest=false&buildCount=40)](https://ci.appveyor.com/project/dustinmoris/giraffe-razor/history?branch=develop) +[![Build history](https://buildstats.info/github/chart/giraffe-fsharp/Giraffe.Razor?branch=develop&includeBuildsFromPullRequest=false)](https://github.com/giraffe-fsharp/Giraffe.Razor/actions?query=branch%3Adevelop++) ## Table of contents @@ -153,15 +153,13 @@ Please find a fully functioning sample application under [./samples/GiraffeRazor ## Nightly builds and NuGet feed -All official Giraffe packages are published to the official and public NuGet feed. +All official release packages are published to the official and public NuGet feed. -Unofficial builds (such as pre-release builds from the `develop` branch and pull requests) produce unofficial pre-release NuGet packages which can be pulled from the project's public NuGet feed on AppVeyor: +Nightly builds (builds from the `develop` branch) produce unofficial pre-release packages which can be pulled from the [project's NuGet feed on GitHub](https://github.com/orgs/giraffe-fsharp/packages). -``` -https://ci.appveyor.com/nuget/giraffe-razor -``` +These packages are being tagged with the Workflow's run number as the package version. -If you add this source to your NuGet CLI or project settings then you can pull unofficial NuGet packages for quick feature testing or urgent hot fixes. +All other builds, such as builds triggered by pull requests produce a NuGet package which can be downloaded as an artifact from the individual GitHub action. ## More information From 60bbbf4b015ab896bfaae20d9085da95255cd4b6 Mon Sep 17 00:00:00 2001 From: Dustin Moris Gorski Date: Sat, 27 Jun 2020 02:05:17 +0100 Subject: [PATCH 12/12] Build fix --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e47ffc9..c6eac55 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: nupkg - path: ./src/*/bin/Release/*.nupkg + path: ./src/${{ env.PROJECT_NAME }}/bin/Release/*.nupkg prerelease: needs: build if: github.ref == 'refs/heads/develop'