-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (63 loc) · 1.62 KB
/
cicd.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
dotnet_versions: |
6.0.x
7.0.x
jobs:
ci:
name: CI
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Setup dotnet
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{env.dotnet_versions}}
- name: Clean nuget
run: dotnet nuget locals all --clear
- name: Build
run: dotnet build -c Release
- name: Test
if: success()
run: dotnet test -c Release --no-build
cd:
name: CD
needs: ci
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Setup dotnet
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{env.dotnet_versions}}
- name: Clean nuget
run: dotnet nuget locals all --clear
- name: Build
run: dotnet build -c Release
- name: publish on version change
id: publish_nuget
if: ${{ success() && (github.event_name == 'push' && github.ref == 'refs/heads/main')}}
uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: src/dsian.TcPnScanner.CLI/dsian.TcPnScanner.CLI.csproj
NUGET_KEY: ${{secrets.TCHAXX_NUGET_API_KEY}}