Skip to content

Update build.yml

Update build.yml #24

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-24.04 #ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4 #actions/checkout@v3
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '3.1.x' # .NET Core 3.1 SDK supports .NET Standard 2.0 and 2.1
- name: Install OpenSSL 1.1
run: |
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb
- 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