diff --git a/.github/workflows/nuget-publish-github.yml b/.github/workflows/nuget-publish-github.yml deleted file mode 100644 index 930dc44..0000000 --- a/.github/workflows/nuget-publish-github.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Nuget Publish to github -on: - [workflow_dispatch] -jobs: - publish: - name: nuget publish to github packages - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.x - - name: Pack - run: dotnet pack src/RulesEngine/RulesEngine.csproj --configuration Release - - name: Publish - run: find ./src/RulesEngine/bin/Release -iname "*.nupkg" | xargs dotnet nuget push -s https://nuget.pkg.github.com/microsoft/index.json -k ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/nuget-publish.yml b/.github/workflows/nuget-publish.yml deleted file mode 100644 index 9bc04fa..0000000 --- a/.github/workflows/nuget-publish.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Nuget Publish -on: - [workflow_dispatch] -jobs: - publish: - name: build, pack & publish - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Setup dotnet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.x - - # Publish - - name: publish on version change - id: publish_nuget - uses: rohith/publish-nuget@v2 - with: - # Filepath of the project to be packaged, relative to root of repository - PROJECT_FILE_PATH: src/RulesEngine/RulesEngine.csproj - - # NuGet package id, used for version detection & defaults to project name - # PACKAGE_NAME: Core - - # Filepath with version info, relative to root of repository & defaults to PROJECT_FILE_PATH - # VERSION_FILE_PATH: Directory.Build.props - - # Regex pattern to extract version info in a capturing group - # VERSION_REGEX: ^\s*(.*)<\/Version>\s*$ - - # Useful with external providers like Nerdbank.GitVersioning, ignores VERSION_FILE_PATH & VERSION_REGEX - # VERSION_STATIC: 1.0.0 - - # Flag to toggle git tagging, enabled by default - # TAG_COMMIT: true - - # Format of the git tag, [*] gets replaced with actual version - # TAG_FORMAT: v* - - # API key to authenticate with NuGet server - NUGET_KEY: ${{secrets.NUGET_API_KEY}} - - # NuGet server uri hosting the packages, defaults to https://api.nuget.org - # NUGET_SOURCE: https://api.nuget.org - - # Flag to toggle pushing symbols along with nuget package to the server, disabled by default - # INCLUDE_SYMBOLS: false diff --git a/.gitignore b/.gitignore index 728408d..9b0709d 100644 --- a/.gitignore +++ b/.gitignore @@ -330,4 +330,8 @@ ASALocalRun/ .mfractor/ /src/RulesEngine/RulesEngine.sln.licenseheader /assets/RulesEnginePackageFile.xml -coveragereport/ \ No newline at end of file +coveragereport/ + +src/**/*.snk + +dist \ No newline at end of file diff --git a/deployment/build-signed.ps1 b/deployment/build-signed.ps1 new file mode 100644 index 0000000..b6c57b4 --- /dev/null +++ b/deployment/build-signed.ps1 @@ -0,0 +1,15 @@ +param( + [Parameter(Mandatory)] + [string] $csprojFilePath, + [Parameter(Mandatory)] + [string] $signingKey +) + +# sign and build the project +$directory = Split-Path $csprojFilePath; +$signKeyFile = Join-Path $directory "signKey.snk"; + +$bytes = [Convert]::FromBase64String($signingKey) +[IO.File]::WriteAllBytes($signKeyFile, $bytes) + +dotnet build $csprojFilePath -c Release -p:ContinuousIntegrationBuild=true -p:DelaySign=false -p:AssemblyOriginatorKeyFile=$signKeyFile \ No newline at end of file diff --git a/signing/RulesEngine-publicKey.snk b/signing/RulesEngine-publicKey.snk new file mode 100644 index 0000000..10341c9 Binary files /dev/null and b/signing/RulesEngine-publicKey.snk differ diff --git a/src/RulesEngine/Properties/AssemblyInfo.cs b/src/RulesEngine/Properties/AssemblyInfo.cs index ef8ec97..1bda149 100644 --- a/src/RulesEngine/Properties/AssemblyInfo.cs +++ b/src/RulesEngine/Properties/AssemblyInfo.cs @@ -8,4 +8,4 @@ using System.Runtime.InteropServices; // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] -[assembly: InternalsVisibleTo("RulesEngine.UnitTest")] +[assembly: InternalsVisibleTo("RulesEngine.UnitTest, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c15956b2ac0945c55b69a185f5c3e02276693b0a5e42c8a1f08cb24e03dd87d91f9fa09f79b6b7b3aac4df46f2ea4ce4bfa31920bb0aad9f02793ab29de9fbf40f5ba9e347aa8569128459f31da1f6357eabe6e1308ac7c16b87a4d61e8d1785746a57ec67956d2e2454b3c98502a5d5c4a4168133bfaa431207c108efae03aa")] diff --git a/src/RulesEngine/RulesEngine.csproj b/src/RulesEngine/RulesEngine.csproj index 4b9638c..c21edd8 100644 --- a/src/RulesEngine/RulesEngine.csproj +++ b/src/RulesEngine/RulesEngine.csproj @@ -19,6 +19,11 @@ true true snupkg + True + ..\..\signing\RulesEngine-publicKey.snk + True + true + true diff --git a/test/RulesEngine.UnitTest/RulesEngine.UnitTest.csproj b/test/RulesEngine.UnitTest/RulesEngine.UnitTest.csproj index f29636e..7c5d82c 100644 --- a/test/RulesEngine.UnitTest/RulesEngine.UnitTest.csproj +++ b/test/RulesEngine.UnitTest/RulesEngine.UnitTest.csproj @@ -1,6 +1,9 @@  netcoreapp3.1 + True + ..\..\signing\RulesEngine-publicKey.snk + True