Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
asulwer committed Jul 3, 2024
2 parents 9eb458c + c1572e2 commit 1779b06
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 1 deletion.
68 changes: 68 additions & 0 deletions .github/workflows/dotnetcore-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and Publish NuGet Package

on:
push:
tags:
- 'v*.*.*'

jobs:
build:
runs-on: ubuntu-latest

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

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

- name: Restore dependencies
run: dotnet restore

- name: Sign and Build Project
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
run: |
pwsh -File ./deployment/build-signed.ps1 -csprojFilePath './src/RulesEngine/RulesEngine.csproj' -signingKey $SIGNING_KEY
- name: Create NuGet package
run: |
# Extract version from the tag
VERSION=$(echo ${{ github.ref }} | sed 's/refs\/tags\/v//')
# Create the NuGet package with the version from the tag
dotnet pack --configuration Release --no-build --output ./nuget_packages /p:PackageVersion=$VERSION
- name: Publish NuGet package to NuGet.org
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ./nuget_packages/*.nupkg -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json

- name: Create source code zip
run: |
git archive -o source.zip HEAD
continue-on-error: true

- name: Create source code tar
run: |
git archive -o source.tar.gz HEAD
continue-on-error: true

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: source-archives
path: |
source.zip
source.tar.gz
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
./nuget_packages/*.nupkg
source.zip
source.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions benchmark/RulesEngineBenchmark/RulesEngineBenchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions demo/DemoApp/DemoApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<StartupObject>DemoApp.Program</StartupObject>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions deployment/build-signed.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ param(
# sign and build the project
$directory = Split-Path $csprojFilePath;
$signKeyFile = Join-Path $directory "signKey.snk";
$signKeyFile = [System.IO.Path]::GetFullPath($signKeyFile)

$bytes = [Convert]::FromBase64String($signingKey)
[IO.File]::WriteAllBytes($signKeyFile, $bytes)
Expand Down
Binary file modified signing/RulesEngine-publicKey.snk
Binary file not shown.
2 changes: 1 addition & 1 deletion src/RulesEngine/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
// 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, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c15956b2ac0945c55b69a185f5c3e02276693b0a5e42c8a1f08cb24e03dd87d91f9fa09f79b6b7b3aac4df46f2ea4ce4bfa31920bb0aad9f02793ab29de9fbf40f5ba9e347aa8569128459f31da1f6357eabe6e1308ac7c16b87a4d61e8d1785746a57ec67956d2e2454b3c98502a5d5c4a4168133bfaa431207c108efae03aa")]
[assembly: InternalsVisibleTo("RulesEngine.UnitTest, PublicKey=0024000004800000940000000602000000240000525341310004000001000100112dc71470f95d4d3cbd1c61a2ed2fbc0480d332aa06932c4ac9450b321b94237bd05e592686b78cec721a1d77c4030f9fd357cefbed3296bcb4f91f6724de444684eab5fd59d85faac37fdb8f0d336d975cfbeb8bc309a59dc208822493c19ad5ce0c7c904a32ca45170b50d6b43040b59ca21d4c0d93b7d0b520b82ac313d8")]
1 change: 1 addition & 0 deletions test/RulesEngine.UnitTest/RulesEngine.UnitTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\signing\RulesEngine-publicKey.snk</AssemblyOriginatorKeyFile>
<DelaySign>True</DelaySign>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoFixture" Version="4.18.1" />
Expand Down

0 comments on commit 1779b06

Please sign in to comment.