-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (38 loc) · 1.29 KB
/
ci.yml
File metadata and controls
47 lines (38 loc) · 1.29 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
name: CI for Pull-Requests
on:
push:
branches: [ develop, main ]
paths:
- 'src/**'
- 'tests/**'
- 'AsyncStateMachine.sln'
- '**/ci.yml'
pull_request:
branches: [ dev, main ]
paths:
- 'src/**'
- 'tests/**'
- 'AsyncStateMachine.sln'
- '**/ci.yml'
workflow_dispatch:
jobs:
build:
name: Build and Run UnitTests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.x'
include-prerelease: false
- name: Restore dependencies
run: dotnet restore
- name: Build solution
run: dotnet build AsyncStateMachine.sln --configuration Release --no-restore
- name: Run UnitTests
run: dotnet test --no-restore --no-build --configuration Release
- name: Build nuget package
run: dotnet pack src/AsyncStateMachine/AsyncStateMachine.csproj --configuration Release --verbosity normal --output .
- name: Publish nuget package
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate