-
-
Notifications
You must be signed in to change notification settings - Fork 166
45 lines (40 loc) · 1.21 KB
/
build.yml
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
name: Build and Test
on:
workflow_dispatch: # Allow running the workflow manually from the GitHub UI
push:
paths:
- 'Src/**'
- '.github/workflows/**'
branches: [ master ]
pull_request:
paths:
- 'Src/**'
- '.github/workflows/**'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
#packages: write
steps:
- uses: actions/checkout@v4
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
working-directory: ./Src
run: dotnet restore
- name: Build
working-directory: ./Src
run: dotnet build --configuration Release --no-restore
- name: Test
working-directory: ./Src
run: |
dotnet test --configuration Release --no-restore --no-build --verbosity normal
#- name: Create NuGet packages
# run: |
# dotnet pack --configuration Release --output $GITHUB_WORKSPACE/out Src/SmtpServer/SmtpServer.csproj
#- name: Push NuGet packages
# run: |
# dotnet nuget push $GITHUB_WORKSPACE/out/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_TOKEN}} --skip-duplicate --no-symbols