Skip to content

Set up package publishing and adjust a bunch of project-related stuff… #1

Set up package publishing and adjust a bunch of project-related stuff…

Set up package publishing and adjust a bunch of project-related stuff… #1

Workflow file for this run

name: Publish NuGet Package
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Restore dependencies
run: dotnet restore
- name: Build the project
run: dotnet build --configuration Release --no-restore
- name: Pack the project
run: dotnet pack --configuration Release --no-build --output ./nupkg
- name: Publish to GitHub Packages
run: dotnet nuget push ./nupkg/*.nupkg --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --api-key ${{ secrets.GITHUB_TOKEN }}
- name: Publish to NuGet.org
run: dotnet nuget push ./nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}