Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: publish-nuget

on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
skip_duplicate:
description: 'Skip if package version already exists on nuget.org'
required: false
default: 'true'
type: boolean

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
9.0.x
10.0.x

- name: Restore dependencies
run: dotnet restore src/RulesEngine/RulesEngine.csproj

- name: Build signed
run: >
dotnet build src/RulesEngine/RulesEngine.csproj
--configuration Release
-p:ContinuousIntegrationBuild=true
-p:DelaySign=false
-p:AssemblyOriginatorKeyFile=../../signing/RulesEngine-publicKey.snk

- name: Pack
run: >
dotnet pack src/RulesEngine/RulesEngine.csproj
--no-build
--configuration Release
-p:ContinuousIntegrationBuild=true
--output ./artifacts

- name: Push packages to nuget.org
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
dotnet nuget push "./artifacts/*.nupkg" \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
# Push symbol packages if present
if ls ./artifacts/*.snupkg 1>/dev/null 2>&1; then
dotnet nuget push "./artifacts/*.snupkg" \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
fi
Loading