v1.0.1 release #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |