Skip to content

Update nuget-package.yml #3

Update nuget-package.yml

Update nuget-package.yml #3

Workflow file for this run

name: Publish NuGet Package
on:
push:
tags: [ 'v*.*.*', 'v*.*', 'v*.*.*-alpha*', 'v*.*-alpha*' ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
source-url: https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
- name: Restore dependencies
run: dotnet restore
- name: Build project
run: dotnet build src/Gml.Core.Interfaces/Gml.Core.Interfaces.csproj --configuration Release
- name: Pack NuGet package
run: dotnet pack src/Gml.Core.Interfaces/Gml.Core.Interfaces.csproj --configuration Release --no-build --output ./nupkgs
- name: Publish to NuGet.org
run: dotnet nuget push "./nupkgs/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
- name: Publish to GitHub Packages
run: dotnet nuget push "./nupkgs/*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json