Skip to content

Commit 6cd1c76

Browse files
committed
Convert to NuGet CPM.
1 parent b426995 commit 6cd1c76

24 files changed

+199
-734
lines changed

.config/dotnet-tools.json

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
on:
2+
push:
3+
tags:
4+
- "giraffe-v[0-9]+.[0-9]+.[0-9]+"
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
14+
- name: Verify commit exists in origin/main
15+
run: |
16+
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
17+
git branch --remote --contains | grep origin/main
18+
19+
- name: Set VERSION variable from tag
20+
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
21+
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v1
24+
with:
25+
dotnet-version: 8.0.x
26+
27+
- name: Install .NET dependencies
28+
run: dotnet restore --locked-mode
29+
30+
- name: Build
31+
run: dotnet build --configuration Release /p:NuGetVersion=${VERSION}
32+
33+
- name: Test
34+
run: dotnet test --configuration Release /p:NuGetVersion=${VERSION} --no-build --verbosity normal
35+
36+
- name: Pack
37+
run: dotnet pack --configuration Release /p:NuGetVersion=${VERSION} /p:PackageVersion=${VERSION} --output .
38+
39+
- name: Push
40+
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}
41+
42+
env:
43+
AMPERSAND_NUGET_KEY: ${{ secrets.AMPERSAND_NUGET_KEY }}

.github/workflows/release.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@ jobs:
2222
- name: Setup .NET
2323
uses: actions/setup-dotnet@v1
2424
with:
25-
dotnet-version: 6.0.x
26-
27-
- name: Restore .NET tools
28-
run: dotnet tool restore
25+
dotnet-version: 8.0.x
2926

3027
- name: Install .NET dependencies
31-
run: dotnet paket install
28+
run: dotnet restore --locked-mode
3229

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

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

4239
- name: Push
43-
run: dotnet nuget push FSharp.Data.Validation.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${AMPERSAND_NUGET_KEY}
40+
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}
4441

4542
env:
4643
AMPERSAND_NUGET_KEY: ${{ secrets.AMPERSAND_NUGET_KEY }}

.github/workflows/test.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@ jobs:
1717
- name: Setup .NET
1818
uses: actions/setup-dotnet@v1
1919
with:
20-
dotnet-version: 6.0.x
21-
22-
- name: Restore .NET tools
23-
run: dotnet tool restore
20+
dotnet-version: 8.0.x
2421

2522
- name: Install .NET dependencies
26-
run: dotnet paket install
23+
run: dotnet restore --locked-mode
2724

2825
- name: Build .NET
2926
run: dotnet build

.paket/Paket.Restore.targets

Lines changed: 0 additions & 557 deletions
This file was deleted.

paket.dependencies

Lines changed: 0 additions & 13 deletions
This file was deleted.

paket.lock

Lines changed: 0 additions & 70 deletions
This file was deleted.

samples/Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project>
2+
<PropertyGroup>
3+
<WarningsAsErrors>FS0025</WarningsAsErrors>
4+
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
5+
</PropertyGroup>
6+
</Project>
Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
5-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
6-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
6+
<IsPackable>false</IsPackable>
7+
</PropertyGroup>
78

8-
<ItemGroup>
9-
<None Include="paket.references" />
10-
<Compile Include="Primitives.fs" />
11-
<Compile Include="ComplexTypes.fs" />
12-
</ItemGroup>
9+
<ItemGroup>
10+
<Compile Include="Primitives.fs" />
11+
<Compile Include="ComplexTypes.fs" />
12+
</ItemGroup>
1313

14-
<ItemGroup>
15-
<ProjectReference Include="..\..\src\FSharp.Data.Validation\FSharp.Data.Validation.fsproj" />
16-
</ItemGroup>
17-
<Import Project="..\..\.paket\Paket.Restore.targets" />
14+
<ItemGroup>
15+
<ProjectReference Include="..\..\src\FSharp.Data.Validation\FSharp.Data.Validation.fsproj" />
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<PackageReference Update="FSharp.Core" Version="[6,)" />
20+
</ItemGroup>
1821

1922
</Project>

samples/FSharp.Data.Validation.Samples/Primitives.fs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ open System.Linq
66

77
open FSharp.Data.Validation
88

9-
type UsernameFailures =
9+
type UsernameFailures =
1010
| Empty
1111

12-
type EmailAddressFailures =
12+
type EmailAddressFailures =
1313
| InvalidFormat
1414

15-
type PhoneNumberFailures =
15+
type PhoneNumberFailures =
1616
| Empty
1717
| NumericStringOnly
1818
| InvalidFormat
1919

20-
type ZipCodeFailures =
20+
type ZipCodeFailures =
2121
| Empty
2222
| NumericStringOnly
2323
| InvalidFormat
@@ -30,7 +30,7 @@ type MyFailures =
3030
| InvalidZipCode of ZipCodeFailures
3131
| EmailAddressMatchesUsername
3232

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

3636
// app specific types
@@ -48,8 +48,8 @@ module Username =
4848

4949
type EmailAddress = private EmailAddress of string
5050

51-
module EmailAddress =
52-
let make s =
51+
module EmailAddress =
52+
let make (s : string) =
5353
validation {
5454
withValue s
5555
disputeWithFact EmailAddressFailures.InvalidFormat (fun s -> Regex.IsMatch(s, "[a-zA-Z0-9+._-]+@[a-zA-Z-]+\\.[a-z]+"))
@@ -87,5 +87,5 @@ module ZipCode =
8787
disputeWithFact ZipCodeFailures.InvalidFormat (isLength 5)
8888
qed ZipCode
8989
} |> fromVCtx
90-
90+
9191
let unwrap (ZipCode s) = s

0 commit comments

Comments
 (0)