Skip to content

Workflow file for this run

name: Publish Nuget Packages
on:
workflow_dispatch:
release:
types:
- published
permissions:
contents: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release
- name: Package
run: dotnet pack --no-build
- name: Publish packages to nuget
run: dotnet nuget push "./dist/*.nupkg" --skip-duplicate -s https://api.nuget.org/v3/index.json -k "$NUGET_API_KEY"
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
- uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: ./dist/*
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./dist/*