-
-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (39 loc) · 1.39 KB
/
dotnet.yml
File metadata and controls
48 lines (39 loc) · 1.39 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
41
42
43
44
45
46
47
48
name: .NET Core
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
strategy:
matrix:
configuration: [Release]
runs-on: ubuntu-latest
env:
Version: 1.3.${{ github.run_number }}
Solution_Path: ./src/GherXunit.sln
Project_Path: ./src/lib/GherXunit/GherXunit.csproj
Package_Path: ./src/lib/GherXunit/**/*.
NUGET_INDEX: https://api.nuget.org/v3/index.json
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
# Execute all unit tests in the solution
- name: Execute unit tests
run: dotnet test ${{ env.Solution_Path }}
# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Build application
run: dotnet build ${{ env.Solution_Path }} --no-restore --configuration ${{ matrix.configuration }}
- name: Publish DLL Artifact
if: github.ref == 'refs/heads/main'
run: |
dotnet pack ${{env.Project_Path}} --no-restore --configuration ${{ matrix.configuration }} -p:PackageVersion=${{ env.Version }}
dotnet nuget push ${{env.Package_Path}}${{ env.Version }}.nupkg --api-key ${{ secrets.NUGET_KEY }} --source ${{ env.NUGET_INDEX }}