Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .config/dotnet-tools.json

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/giraffe-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
push:
tags:
- "giraffe-v[0-9]+.[0-9]+.[0-9]+"
jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Verify commit exists in origin/main
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/main

- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

- name: Install .NET dependencies
run: dotnet restore --locked-mode

- name: Build
run: dotnet build --configuration Release /p:NuGetVersion=${VERSION}

- name: Test
run: dotnet test --configuration Release /p:NuGetVersion=${VERSION} --no-build --verbosity normal

- name: Pack
run: dotnet pack --configuration Release /p:NuGetVersion=${VERSION} /p:PackageVersion=${VERSION} --output .

- name: Push
run: dotnet nuget push FSharp.Data.Validation.Giraffe.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${AMPERSAND_NUGET_KEY} --symbol-source https://symbols.nuget.org/download/symbols --symbol-api-key ${AMPERSAND_NUGET_KEY}

env:
AMPERSAND_NUGET_KEY: ${{ secrets.AMPERSAND_NUGET_KEY }}
11 changes: 4 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: Restore .NET tools
run: dotnet tool restore
dotnet-version: 8.0.x

- name: Install .NET dependencies
run: dotnet paket install
run: dotnet restore --locked-mode

- name: Build
run: dotnet build --configuration Release /p:NuGetVersion=${VERSION}
Expand All @@ -37,10 +34,10 @@ jobs:
run: dotnet test --configuration Release /p:NuGetVersion=${VERSION} --no-build --verbosity normal

- name: Pack
run: dotnet pack --configuration Release /p:NuGetVersion=${VERSION} /p:PackageVersion=${VERSION} --output .
run: dotnet pack --configuration Release /p:NuGetVersion=${VERSION} /p:PackageVersion=${VERSION} --include-symbols --output .

- name: Push
run: dotnet nuget push FSharp.Data.Validation.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${AMPERSAND_NUGET_KEY}
run: dotnet nuget push FSharp.Data.Validation.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${AMPERSAND_NUGET_KEY} --symbol-source https://symbols.nuget.org/download/symbols --symbol-api-key ${AMPERSAND_NUGET_KEY}

env:
AMPERSAND_NUGET_KEY: ${{ secrets.AMPERSAND_NUGET_KEY }}
7 changes: 2 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: Restore .NET tools
run: dotnet tool restore
dotnet-version: 8.0.x

- name: Install .NET dependencies
run: dotnet paket install
run: dotnet restore --locked-mode

- name: Build .NET
run: dotnet build
Expand Down
557 changes: 0 additions & 557 deletions .paket/Paket.Restore.targets

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Revision history for fsharp-data-validation

## 1.0.1 - 03/14/2022

* Fix package dependency version ranges.

## 1.0.0 - 03/14/2022

* First version. Released on an unsuspecting world.
13 changes: 0 additions & 13 deletions paket.dependencies

This file was deleted.

70 changes: 0 additions & 70 deletions paket.lock

This file was deleted.

6 changes: 6 additions & 0 deletions samples/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<WarningsAsErrors>FS0025</WarningsAsErrors>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<None Include="paket.references" />
<Compile Include="Primitives.fs" />
<Compile Include="ComplexTypes.fs" />
</ItemGroup>
<ItemGroup>
<Compile Include="Primitives.fs" />
<Compile Include="ComplexTypes.fs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\FSharp.Data.Validation\FSharp.Data.Validation.fsproj" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
<ItemGroup>
<ProjectReference Include="..\..\src\FSharp.Data.Validation\FSharp.Data.Validation.fsproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="FSharp.Core" Version="[6,)" />
</ItemGroup>

</Project>
16 changes: 8 additions & 8 deletions samples/FSharp.Data.Validation.Samples/Primitives.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ open System.Linq

open FSharp.Data.Validation

type UsernameFailures =
type UsernameFailures =
| Empty

type EmailAddressFailures =
type EmailAddressFailures =
| InvalidFormat

type PhoneNumberFailures =
type PhoneNumberFailures =
| Empty
| NumericStringOnly
| InvalidFormat

type ZipCodeFailures =
type ZipCodeFailures =
| Empty
| NumericStringOnly
| InvalidFormat
Expand All @@ -30,7 +30,7 @@ type MyFailures =
| InvalidZipCode of ZipCodeFailures
| EmailAddressMatchesUsername

let private isNumericString (str:string) =
let private isNumericString (str:string) =
str.All(fun c -> Char.IsNumber(c))

// app specific types
Expand All @@ -48,8 +48,8 @@ module Username =

type EmailAddress = private EmailAddress of string

module EmailAddress =
let make s =
module EmailAddress =
let make (s : string) =
validation {
withValue s
disputeWithFact EmailAddressFailures.InvalidFormat (fun s -> Regex.IsMatch(s, "[a-zA-Z0-9+._-]+@[a-zA-Z-]+\\.[a-z]+"))
Expand Down Expand Up @@ -87,5 +87,5 @@ module ZipCode =
disputeWithFact ZipCodeFailures.InvalidFormat (isLength 5)
qed ZipCode
} |> fromVCtx

let unwrap (ZipCode s) = s
19 changes: 19 additions & 0 deletions samples/FSharp.Data.Validation.Samples/packages.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": 1,
"dependencies": {
"net8.0": {
"FSharp.Core": {
"type": "Direct",
"requested": "[6.0.0, )",
"resolved": "6.0.0",
"contentHash": "fbv1UwJ2LXVcFCt+GGDPu0sIYA5C6gdDvAupDj3iLQF3clRkua/6J33f+FiGQa8P1tEa+zmz3wrjoTnXZ1UiYg=="
},
"fsharp.data.validation": {
"type": "Project",
"dependencies": {
"FSharp.Core": "[6.0.0, )"
}
}
}
}
}
1 change: 0 additions & 1 deletion samples/FSharp.Data.Validation.Samples/paket.references

This file was deleted.

9 changes: 6 additions & 3 deletions samples/GettingStarted/GettingStarted.fsproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
<Compile Include="Types.fs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\FSharp.Data.Validation\FSharp.Data.Validation.fsproj" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />

<ItemGroup>
<PackageReference Update="FSharp.Core" Version="[6,)" />
</ItemGroup>
</Project>
19 changes: 19 additions & 0 deletions samples/GettingStarted/packages.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": 1,
"dependencies": {
"net8.0": {
"FSharp.Core": {
"type": "Direct",
"requested": "[6.0.0, )",
"resolved": "6.0.0",
"contentHash": "fbv1UwJ2LXVcFCt+GGDPu0sIYA5C6gdDvAupDj3iLQF3clRkua/6J33f+FiGQa8P1tEa+zmz3wrjoTnXZ1UiYg=="
},
"fsharp.data.validation": {
"type": "Project",
"dependencies": {
"FSharp.Core": "[6.0.0, )"
}
}
}
}
}
1 change: 0 additions & 1 deletion samples/GettingStarted/paket.references

This file was deleted.

23 changes: 23 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project>
<PropertyGroup>
<Authors>Matanuska Telecom Association</Authors>
<Company>Matanuska Telecom Association</Company>
<WarningsAsErrors>FS0025</WarningsAsErrors>

<!-- See: https://github.com/dotnet/sourcelink/ -->
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/alasconnect/fsharp-data-validation</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugSymbols>true</DebugSymbols>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="[1,)" PrivateAssets="All" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions src/FSharp.Data.Validation.Giraffe/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Revision history for fsharp-data-validation

## 1.0.0 - 11/17/2023

* Fix package dependency version ranges.

## 0.0.1 - 07/21/2023

* First version of library to provide useful alternative to Giraffe interface for integrating with FSharp.Data.Validation library.
Loading