Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/updatedotnet #3

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.100
dotnet-version: 7.x
- name: Restore
run: dotnet restore
- name: Build
Expand All @@ -40,7 +40,11 @@ jobs:
run: dotnet test -c Release
- name: Pack
if: matrix.os == 'ubuntu-latest'
run: dotnet pack -v normal -c Release --no-restore --include-symbols --include-source -p:PackageVersion=$GITHUB_RUN_ID src/$PROJECT_NAME/$PROJECT_NAME.*proj
run: |
latestTag=$(git describe --tags --abbrev=0 2>/dev/null || echo 0.0.1)
runId=$GITHUB_RUN_ID
packageVersion="${latestTag//v}-build.${runId}"
dotnet pack -v normal -c Release --no-restore --include-symbols --include-source -p:PackageVersion=$packageVersion src/$PROJECT_NAME/$PROJECT_NAME.*proj
- name: Upload Artifact
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -71,7 +75,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.100
dotnet-version: 7.x
- name: Create Release NuGet package
run: |
arrTag=(${GITHUB_REF//\// })
Expand Down
6 changes: 6 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Release Notes
=============

## 4.0.0-rc-1

- Updated to .NET 7
- Updated to latest Giraffe 6.2.0
- Swapped Ply for native F# task

## 3.0.0-rc-1

- Updated to .NET 5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<AssemblyName>GiraffeDotLiquidSample.Tests</AssemblyName>
<PreserveCompilationContext>true</PreserveCompilationContext>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.*" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.*" />
<PackageReference Include="xunit" Version="2.4.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.10" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="FSharp.Core" Version="7.0.400" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/GiraffeDotLiquidSample.Tests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let readText (response : HttpResponseMessage) =
response.Content.ReadAsStringAsync()
|> runTask

let shouldEqual expected actual =
let shouldEqual (expected : string) (actual : string) =
Assert.Equal(expected, actual)

// ---------------------------------
Expand Down
6 changes: 5 additions & 1 deletion samples/GiraffeDotLiquidSample/GiraffeDotLiquidSample.fsproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<AssemblyName>GiraffeDotLiquidSample</AssemblyName>
<EnableDefaultContentItems>false</EnableDefaultContentItems>
<RunWorkingDirectory>$(MSBuildThisFileDirectory)</RunWorkingDirectory>
Expand All @@ -25,4 +25,8 @@
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Update="FSharp.Core" Version="7.0.400" />
</ItemGroup>

</Project>
13 changes: 12 additions & 1 deletion samples/GiraffeDotLiquidSample/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,22 @@ let personTemplate = "<html><head><title>DotLiquid</title></head><body><p>First

let fooBar = { FirstName = "Foo"; LastName = "Bar" }

let renderIndex =
"""
<p>non razor index</p>
<ul>
<li><a href=/person>person</a></li></li>
<li><a href=/person2>person2</a></li>
<li><a href=/person3>person3</a></li>
</ul>
"""
|> htmlString

let webApp =
choose [
GET >=>
choose [
route "/" >=> text "index"
route "/" >=> renderIndex
route "/person" >=> dotLiquid "text/html" personTemplate fooBar
route "/person2" >=> dotLiquidTemplate "text/html" "Templates/Person.liquid" fooBar
route "/person3" >=> dotLiquidHtmlTemplate "Templates/Person.liquid" fooBar
Expand Down
10 changes: 5 additions & 5 deletions src/Giraffe.DotLiquid/Giraffe.DotLiquid.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<NoWarn>$(NoWarn);NU5104</NoWarn>

<!-- Build config -->
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<DebugType>portable</DebugType>
<OutputType>Library</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down Expand Up @@ -44,10 +44,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Giraffe" Version="5.0.0-rc-6" />
<PackageReference Include="Ply" Version="0.3.*" />
<PackageReference Include="DotLiquid" Version="2.0.*"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.*" PrivateAssets="All" />
<PackageReference Include="Giraffe" Version="6.2.0" />
<PackageReference Include="DotLiquid" Version="2.2.692" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Update="FSharp.Core" Version="7.0.400" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion src/Giraffe.DotLiquid/HttpHandlers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ open Microsoft.AspNetCore.Hosting
open Microsoft.Extensions.DependencyInjection
open DotLiquid
open Giraffe
open FSharp.Control.Tasks

/// Renders a model and a template with the DotLiquid template engine and sets the HTTP response
/// with the compiled output as well as the Content-Type HTTP header to the given value.
Expand Down
16 changes: 10 additions & 6 deletions tests/Giraffe.DotLiquid.Tests/Giraffe.DotLiquid.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<AssemblyName>Giraffe.DotLiquid.Tests</AssemblyName>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.*" />
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.*"/>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.*" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.*" />
<PackageReference Include="NSubstitute" Version="4.2.*" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.10" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="4.4.0" />
<PackageReference Update="FSharp.Core" Version="7.0.400" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion tests/Giraffe.DotLiquid.Tests/HttpHandlerTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ open System.IO
open System.Text
open System.Threading.Tasks
open Microsoft.AspNetCore.Http
open FSharp.Control.Tasks
open Giraffe
open Xunit
open NSubstitute
Expand Down
1 change: 0 additions & 1 deletion tests/Giraffe.DotLiquid.Tests/TokenRouterTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ open System.IO
open System.Text
open System.Threading.Tasks
open Microsoft.AspNetCore.Http
open FSharp.Control.Tasks
open Giraffe
open Xunit
open NSubstitute
Expand Down
Loading