Skip to content

Publish to NuGet

Publish to NuGet #1

Workflow file for this run

name: Publish to NuGet
on:
workflow_dispatch:
release:
types: [published]
jobs:
build:
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Configure NuGet
run: dotnet nuget add source https://nuget.pkg.github.com/tech-software/index.json --name github --username tech-software --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test -c Release --no-build --verbosity normal
- name: Pack unsigned
run: dotnet pack -c Release --no-build -p:PublicRelease=true
- name: Publish packages
run: |
dotnet nuget push src/NCalc.Core/bin/Release/TSNCalc.Core*.nupkg --api-key "${{ secrets.GITHUB_TOKEN }}" --source github --skip-duplicate
dotnet nuget push src/NCalc.Sync/bin/Release/TSNCalcSync*.nupkg --api-key "${{ secrets.GITHUB_TOKEN }}" --source github --skip-duplicate
# dotnet nuget push src/NCalc.Async/bin/Release/NCalcAsync*.nupkg --api-key "${{ secrets.GITHUB_TOKEN }}" --source github --skip-duplicate
# dotnet nuget push src/NCalc.DependencyInjection/bin/Release/NCalc.DependencyInjection*.nupkg --api-key "${{ secrets.GITHUB_TOKEN }}" --source github --skip-duplicate
# dotnet nuget push src/Plugins/NCalc.MemoryCache/bin/Release/NCalc.MemoryCache*.nupkg --api-key "${{ secrets.GITHUB_TOKEN }}" --source github --skip-duplicate
# dotnet nuget push src/Plugins/NCalc.Antlr/bin/Release/NCalc.Antlr*.nupkg --api-key "${{ secrets.GITHUB_TOKEN }}" --source github --skip-duplicate