-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (31 loc) · 1.27 KB
/
build.yml
File metadata and controls
40 lines (31 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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@v4 #actions/checkout@v3
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x' #'3.1.x' # .NET Core 3.1 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