Skip to content

Merge remote-tracking branch 'origin/main' #2

Merge remote-tracking branch 'origin/main'

Merge remote-tracking branch 'origin/main' #2

Workflow file for this run

name: NuGet Publish
on:
push:
branches: [ main, master ]
paths:
- '**.cs'
- '**.csproj'
- '.github/workflows/nuget-publish.yml'
release:
types: [ published ]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET SDKs
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build solution
run: dotnet build --configuration Release --no-restore
- name: Run tests
run: dotnet test --configuration Release --no-build --verbosity normal
- name: Pack NuGet package
run: dotnet pack SWEN3.Paperless.RabbitMq/SWEN3.Paperless.RabbitMq.csproj --configuration Release --no-build --output ./nupkg -p:GeneratePackageOnBuild=false
- name: Publish packages to NuGet.org
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
run: |
dotnet nuget push ./nupkg/*.nupkg \
--api-key ${{ secrets.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate