Pack and Publish Nuget to Nuget.org #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This GitHub Action simply builds, packs and publishes the package to Nuget.org | |
# You will need to manually trigger it. | |
# by @geoperez and @mariodivece | |
name: Pack and Publish to Nuget.org | |
on: workflow_dispatch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
PROJECT_FILE_PATH: '/home/runner/work/tubular-dotnet/tubular-dotnet/src/Unosquare.Tubular/Unosquare.Tubular.csproj' | |
BUILD_PATH: '/home/runner/work/tubular-dotnet/tubular-dotnet/src/Unosquare.Tubular/bin/Release/*.nupkg' | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
steps: | |
- name: 🚕 Checkout codebase | |
uses: actions/checkout@v4 | |
- name: 🐜 Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
9.x | |
- name: 🏗 Build, Pack and Publish to Nuget.org | |
run: | | |
dotnet pack ${{ env.PROJECT_FILE_PATH }} --configuration Release -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg | |
dotnet nuget push ${{ env.BUILD_PATH }} --source https://api.nuget.org/v3/index.json --api-key ${{ env.NUGET_API_KEY }} |