Skip to content

Update build.yml

Update build.yml #17

Workflow file for this run

name: Build C# Class Library for .NET Standard 2.x
on:
push:
branches:
# - '**' # Trigger on pushes to any branch
- 'master' # Trigger on pushes to any branch
# pull_request:
# branches:
# - '**' # Trigger on pull requests from any branch
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x' # .NET Core 6.0.x SDK supports .NET Standard 2.0 and 2.1
- name: Install dependencies
run: dotnet restore ./Source/NovusCodeLibrary.sln
- name: Build the project
run: dotnet build ./Source/NovusCodeLibrary.sln --configuration Release --no-restore
- name: Publish to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
dotnet pack ./Source/NovusCodeLibrary.sln --configuration Release --no-build --output ./nupkg
dotnet nuget push "./nupkg/*.nupkg" --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json
#- name: Run tests (optional)
# run: dotnet test NovuscodeLibrary.NET/Source/NovusCodeLibrary.sln --configuration Release --no-build --verbosity normal