Skip to content

Commit

Permalink
Convert to NuGet CPM.
Browse files Browse the repository at this point in the history
  • Loading branch information
devinlyons committed Nov 14, 2023
1 parent b426995 commit b93f414
Show file tree
Hide file tree
Showing 25 changed files with 1,328 additions and 721 deletions.
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

- 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

- 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

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

This file was deleted.

5 changes: 5 additions & 0 deletions pack.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dotnet restore
dotnet build --configuration Release
Remove-Item .\packages\*.nupkg
Remove-Item .\packages\*.snupkg
dotnet pack -o .\packages -c Release --include-symbols
13 changes: 0 additions & 13 deletions paket.dependencies

This file was deleted.

70 changes: 0 additions & 70 deletions paket.lock

This file was deleted.

10 changes: 10 additions & 0 deletions samples/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="FSharp.Core" Version="[6,)" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</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" />
</ItemGroup>

</Project>
32 changes: 32 additions & 0 deletions samples/FSharp.Data.Validation.Samples/packages.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"version": 2,
"dependencies": {
"net6.0": {
"Microsoft.Build.Tasks.Git": {
"type": "Transitive",
"resolved": "1.0.0",
"contentHash": "z2fpmmt+1Jfl+ZnBki9nSP08S1/tbEOxFdsK1rSR+LBehIJz1Xv9/6qOOoGNqlwnAGGVGis1Oj6S8Kt9COEYlQ=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
"resolved": "1.0.0",
"contentHash": "G8DuQY8/DK5NN+3jm5wcMcd9QYD90UV7MiLmdljSJixi3U/vNaeBKmmXUqI4DJCOeWizIUEh4ALhSt58mR+5eg=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Transitive",
"resolved": "1.0.0",
"contentHash": "aZyGyGg2nFSxix+xMkPmlmZSsnGQ3w+mIG23LTxJZHN+GPwTQ5FpPgDo7RMOq+Kcf5D4hFWfXkGhoGstawX13Q==",
"dependencies": {
"Microsoft.Build.Tasks.Git": "1.0.0",
"Microsoft.SourceLink.Common": "1.0.0"
}
},
"fsharp.data.validation": {
"type": "Project",
"dependencies": {
"Microsoft.SourceLink.GitHub": "[1.0.0, )"
}
}
}
}
}
1 change: 0 additions & 1 deletion samples/FSharp.Data.Validation.Samples/paket.references

This file was deleted.

6 changes: 4 additions & 2 deletions samples/GettingStarted/GettingStarted.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
<TargetFramework>net6.0</TargetFramework>
</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" />
</ItemGroup>
</Project>
32 changes: 32 additions & 0 deletions samples/GettingStarted/packages.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"version": 2,
"dependencies": {
"net6.0": {
"Microsoft.Build.Tasks.Git": {
"type": "Transitive",
"resolved": "1.0.0",
"contentHash": "z2fpmmt+1Jfl+ZnBki9nSP08S1/tbEOxFdsK1rSR+LBehIJz1Xv9/6qOOoGNqlwnAGGVGis1Oj6S8Kt9COEYlQ=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
"resolved": "1.0.0",
"contentHash": "G8DuQY8/DK5NN+3jm5wcMcd9QYD90UV7MiLmdljSJixi3U/vNaeBKmmXUqI4DJCOeWizIUEh4ALhSt58mR+5eg=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Transitive",
"resolved": "1.0.0",
"contentHash": "aZyGyGg2nFSxix+xMkPmlmZSsnGQ3w+mIG23LTxJZHN+GPwTQ5FpPgDo7RMOq+Kcf5D4hFWfXkGhoGstawX13Q==",
"dependencies": {
"Microsoft.Build.Tasks.Git": "1.0.0",
"Microsoft.SourceLink.Common": "1.0.0"
}
},
"fsharp.data.validation": {
"type": "Project",
"dependencies": {
"Microsoft.SourceLink.GitHub": "[1.0.0, )"
}
}
}
}
}
1 change: 0 additions & 1 deletion samples/GettingStarted/paket.references

This file was deleted.

17 changes: 17 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<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>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" />
</ItemGroup>
</Project>
11 changes: 11 additions & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="FSharp.Core" Version="[6.0.1,)" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="[1,)" />

<PackageVersion Include="Giraffe" Version="[6,)" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
<TargetFramework>net6.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Description>Model validation helpers for Giraffe.</Description>
<Company>Matanuska Telecom Association</Company>
<Authors>Matanuska Telecom Association</Authors>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/alasconnect/fsharp-data-validation</RepositoryUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Version>0.0.1</Version>
</PropertyGroup>
<ItemGroup>
<Compile Include="Library.fs" />
Expand All @@ -21,7 +18,10 @@
<Pack>false</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="paket.references" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />

<ItemGroup>
<PackageReference Update="FSharp.Core" />
<PackageReference Include="Giraffe" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion src/FSharp.Data.Validation.Giraffe/paket.references

This file was deleted.

Loading

0 comments on commit b93f414

Please sign in to comment.