Skip to content

Publish to Nuget

Publish to Nuget #50

Workflow file for this run

name: Publish to Nuget
on:
workflow_dispatch:
jobs:
publish:
env:
SOLUTION: 'GoLive.Generator.ApiClientGenerator/GoLive.Generator.ApiClientGenerator.csproj'
BUILD_VER: '3.0'
name: build, pack & publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Setup NuGet
uses: nuget/setup-nuget@v1
- name: Get Build Version
run: |
echo "BUILD_VERSION=${{ format('{0}.{1}', env.BUILD_VER, github.run_number ) }}" >> $GITHUB_ENV
- name: Build
run: dotnet pack $SOLUTION --configuration Release -p:Version=$BUILD_VERSION -p:PackageVersion=$BUILD_VERSION -p:GeneratePackageOnBuild=false
- name: Publish
run: nuget push **/*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_KEY}}