Skip to content

Fix gha nuget action. #3

Fix gha nuget action.

Fix gha nuget action. #3

Workflow file for this run

name: Publish to NuGet
on:
push:
tags:
- 'v*' # Triggers only on tags starting with "v"
jobs:
build-and-publish:
runs-on: windows-latest # ← must run on Windows for net*-windows projects
strategy:
matrix:
framework: ['net8.0-windows10.0.17763.0']
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore src/SIPSorceryMedia.Windows.csproj
- name: Build
run: dotnet build src/SIPSorceryMedia.Windows.csproj -c Release --no-restore
- name: Pack NuGet package
run: dotnet pack src/SIPSorceryMedia.Windows.csproj -c Release -o ./artifacts --no-build
- name: Publish to NuGet.org
if: startsWith(github.ref, 'refs/tags/v')
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push .\artifacts\*.nupkg --source https://api.nuget.org/v3/index.json --api-key $env:NUGET_API_KEY