CI: fix nuget push (hopefully) #23
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
name: Build | |
on: | |
workflow_dispatch: | |
inputs: | |
perform_deploy: | |
description: "Deploy *.nupkg artifacts to nuget.org" | |
required: true | |
type: boolean | |
push: | |
branches: [ main ] | |
tags: | |
- v* | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- run: git fetch --force --prune --tags | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: "9.0" | |
- name: NuGet Restore | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration release --no-restore | |
- name: Test | |
run: dotnet test --configuration release --no-restore --no-build | |
- name: Pack | |
run: dotnet pack --configuration release --no-restore --no-build | |
- name: Deploy to nuget.org | |
if: ${{ inputs.perform_deploy }} | |
run: dotnet nuget push --api-key ${{secrets.NUGET_PUSH_TOKEN}} --source https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols _artifacts/*.nupkg |