diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7beec3..2302578 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -169,7 +169,7 @@ jobs: # Build the test project - name: Build Solution - run: msbuild EasyVCR.Tests.FSharp\EasyVCR.Tests.FSharp.fsproj /p:platform="Any CPU" /p:configuration="Debug" /p:outputPath="bin/Test" /p:target="Rebuild" -restore + run: make fs-compat-test fw=net8.0 # Always run compatibility tests on the latest framework Visual_Basic_Compatibility: runs-on: windows-2022 @@ -202,7 +202,7 @@ jobs: # Build the test project - name: Build Solution - run: msbuild EasyVCR.Tests.VB\EasyVCR.Tests.VB.vbproj /p:platform="Any CPU" /p:configuration="Debug" /p:outputPath="bin/Test" /p:target="Rebuild" -restore + run: make vb-compat-test fw=net8.0 # Always run compatibility tests on the latest framework # .NET Standard notes: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 149eb1c..f2dc9c1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,7 @@ name: Release on: release: types: [ published ] + workflow_dispatch: jobs: publish: diff --git a/EasyVCR.Tests.FSharp/EasyVCR.Tests.FSharp.fsproj b/EasyVCR.Compatibility.FSharp/EasyVCR.Compatibility.FSharp.fsproj similarity index 91% rename from EasyVCR.Tests.FSharp/EasyVCR.Tests.FSharp.fsproj rename to EasyVCR.Compatibility.FSharp/EasyVCR.Compatibility.FSharp.fsproj index 9641b81..8cbe39a 100644 --- a/EasyVCR.Tests.FSharp/EasyVCR.Tests.FSharp.fsproj +++ b/EasyVCR.Compatibility.FSharp/EasyVCR.Compatibility.FSharp.fsproj @@ -1,8 +1,9 @@  + EasyVCR.Compatibility.FSharp net8.0 - true + false true diff --git a/EasyVCR.Tests.FSharp/FSharpCompileTest.fs b/EasyVCR.Compatibility.FSharp/FSharpCompileTest.fs similarity index 69% rename from EasyVCR.Tests.FSharp/FSharpCompileTest.fs rename to EasyVCR.Compatibility.FSharp/FSharpCompileTest.fs index 9d7a318..5842c4a 100644 --- a/EasyVCR.Tests.FSharp/FSharpCompileTest.fs +++ b/EasyVCR.Compatibility.FSharp/FSharpCompileTest.fs @@ -1,7 +1,7 @@ // This test checks that EasyVCR C# code can be used in F#. -// This test project is running on .NET 6.0, although a success here should mean a success in all versions of .NET.' +// This test project is running on the latest .NET, although a success here should mean a success in all versions of .NET.' -namespace EasyVCR.Tests.FSharp +namespace EasyVCR.Compatibility.FSharp open Xunit diff --git a/EasyVCR.Tests.VB/EasyVCR.Tests.VB.vbproj b/EasyVCR.Compatibility.VB/EasyVCR.Compatibility.VB.vbproj similarity index 91% rename from EasyVCR.Tests.VB/EasyVCR.Tests.VB.vbproj rename to EasyVCR.Compatibility.VB/EasyVCR.Compatibility.VB.vbproj index fe84a3f..fbfd030 100644 --- a/EasyVCR.Tests.VB/EasyVCR.Tests.VB.vbproj +++ b/EasyVCR.Compatibility.VB/EasyVCR.Compatibility.VB.vbproj @@ -1,8 +1,9 @@ - EasyVCR.Tests.VB + EasyVCR.Compatibility.VB net8.0 + false true diff --git a/EasyVCR.Tests.VB/VbCompileTest.vb b/EasyVCR.Compatibility.VB/VbCompileTest.vb similarity index 75% rename from EasyVCR.Tests.VB/VbCompileTest.vb rename to EasyVCR.Compatibility.VB/VbCompileTest.vb index 455de53..bc88f21 100644 --- a/EasyVCR.Tests.VB/VbCompileTest.vb +++ b/EasyVCR.Compatibility.VB/VbCompileTest.vb @@ -1,5 +1,5 @@ 'This test checks that EasyVCR C# code can be used in Visual Basic. -'This test project is running on .NET 6.0, although a success here should mean a success in all versions of .NET. +'This test project is running on the latest .NET, although a success here should mean a success in all versions of .NET. Imports Xunit Public Class VbCompileTest diff --git a/EasyVCR.sln b/EasyVCR.sln index 82aa656..2c1987f 100644 --- a/EasyVCR.sln +++ b/EasyVCR.sln @@ -7,9 +7,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyVCR", "EasyVCR\EasyVCR. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyVCR.Tests", "EasyVCR.Tests\EasyVCR.Tests.csproj", "{6DE2872F-98ED-4AE1-8674-F33A36AC2012}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "EasyVCR.Tests.FSharp", "EasyVCR.Tests.FSharp\EasyVCR.Tests.FSharp.fsproj", "{163D6AB6-D5CF-4D77-A2D0-BDF329D99DE4}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "EasyVCR.Compatibility.FSharp", "EasyVCR.Compatibility.FSharp\EasyVCR.Compatibility.FSharp.fsproj", "{163D6AB6-D5CF-4D77-A2D0-BDF329D99DE4}" EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EasyVCR.Tests.VB", "EasyVCR.Tests.VB\EasyVCR.Tests.VB.vbproj", "{B78C8E42-AECD-441A-936C-C0F8F1006E2A}" +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EasyVCR.Compatibility.VB", "EasyVCR.Compatibility.VB\EasyVCR.Compatibility.VB.vbproj", "{B78C8E42-AECD-441A-936C-C0F8F1006E2A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Makefile b/Makefile index d15fc08..5d9f0ce 100644 --- a/Makefile +++ b/Makefile @@ -37,10 +37,6 @@ coverage-check: docs: dotnet tool run docfx docs/docfx.json -## format - Formats the project -format: - dotnet tool run dotnet-format --no-restore - ## install-tools - Install required dotnet tools install-tools: dotnet new tool-manifest || exit 0 @@ -48,10 +44,6 @@ install-tools: dotnet tool install --local dotnet-format || exit 0 dotnet tool install --local docfx --version 2.60.2 || exit 0 -## install-release-tools - Install required tools for release -install-release-tools: - bash scripts/unix/install_osslsigncode.sh - ## install - Install requirements install: | install-tools git submodule init @@ -64,22 +56,27 @@ lint: # Lint the source code by building with the "Linting" configuration (will trigger StyleCop) dotnet build EasyVCR/EasyVCR.csproj -c "Linting" -t:Rebuild -restore -p:EnforceCodeStyleInBuild=true +## lint-fix - Formats the project +lint-fix: + dotnet tool run dotnet-format --no-restore + ## lint-scripts - Lint and validate the Batch scripts (Windows only) lint-scripts: scripts\win\lint_scripts.bat -## prep-release - Build, sign and package the project for distribution, signing with the provided certificate +## publish - Publish the project to NuGet # @parameters: -# sncert= - The strong-name certificate to use for signing the built assets. -# cert= - The authenticity certificate to use for signing the built assets. -# pass= - The password for the authenticity certificate. -prep-release: - bash scripts/unix/build_release_nuget.sh EasyVCR ${sncert} ${cert} ${pass} Release +# key= - The NuGet API key to use for publishing. +# ref: https://learn.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-push +publish: + # Verify that no extraneous .nupkg files exist + dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${key} --skip-duplicate ## release - Cuts a release for the project on GitHub (requires GitHub CLI) # tag = The associated tag title of the release +# target = Target branch or full commit SHA release: - gh release create ${tag} *.nupkg + gh release create ${tag} --target ${target} ## restore - Restore the project restore: @@ -107,6 +104,18 @@ test: # fw= - The framework to build for. test-fw: # Note, running .NET Framework tests on a non-Windows machine may cause issues: https://xunit.net/docs/getting-started/netfx/cmdline - dotnet test EasyVCR.Tests/EasyVCR.Tests.csproj -f ${fw} + dotnet test EasyVCR.Tests/EasyVCR.Tests.csproj -f ${fw} -c "Debug" # Always run unit tests in Debug mode to allow access to internal members + +## fs-compat-test - Run the F# compatibility tests for a specific framework +## @parameters: +## fw= - The framework to build for. +fs-compat-test: + dotnet test EasyVCR.Compatibility.FSharp/EasyVCR.Compatibility.FSharp.fsproj -f ${fw} -restore + +## vb-compat-test - Run the VB compatibility tests for a specific framework +## @parameters: +## fw= - The framework to build for. +vb-compat-test: + dotnet test EasyVCR.Compatibility.VB/EasyVCR.Compatibility.VB.vbproj -f ${fw} -restore -.PHONY: help analyze build build-fw build-prod clean coverage coverage-check docs format install-tools install-release-tools install lint lint-scripts prep-release release restore scan setup-win setup-unix test test-fw +.PHONY: help analyze build build-fw build-prod clean coverage coverage-check docs install-tools install lint lint-fix lint-scripts publish release restore scan setup-win setup-unix test test-fw fs-compat-test vb-compat-test