Skip to content

Update publish-nuget.yml #11

Update publish-nuget.yml

Update publish-nuget.yml #11

Workflow file for this run

name: Publish .NET Template
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore src/template/Aspnext.Template.csproj
- name: Build the project
run: dotnet build src/template/Aspnext.Template.csproj --no-restore --configuration Release
- name: Pack the project
run: dotnet pack src/template/Aspnext.Template.csproj --no-build --configuration Release --output ./nupkg
- name: Publish to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push "./nupkg/*.nupkg" --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Publish to Github Nuget Registry
env:
NUGET_GH_API_KEY: ${{ secrets.GITHUB_TOKEN }}
run: dotnet nuget push "./nupkg/*.nupkg" --api-key $NUGET_GH_API_KEY --source https://nuget.pkg.github.com/MadL1me/index.json --skip-duplicate