-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (46 loc) · 1.22 KB
/
Copy pathdotnet.yml
File metadata and controls
53 lines (46 loc) · 1.22 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
49
50
51
52
53
name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore ./src/
- name: Build
run: dotnet build ./src/ --no-restore
- name: Run docker-compose
uses: sudo-bot/action-docker-compose@latest
with:
cli-args: "up -d"
- name: Test
run: dotnet test ./src/ --no-build --verbosity normal
- name: Shutdown docker-compose
uses: sudo-bot/action-docker-compose@latest
with:
cli-args: "down"
publish:
needs: build
runs-on: ubuntu-latest
environment: nuget
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet pack --configuration Release ./src/ -o ./
- name: Publish
env:
API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push --api-key $API_KEY --source https://api.nuget.org/v3/index.json *.nupkg