-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 2.33 KB
/
main.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
name: CI/CD
on:
pull_request: # CI (pr validation)
branches: [ "main" ]
push: # CI (ci package)
branches: [ "main", "release/v**" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [ '7.0.x' ]
name: Build, Test and (Publish if not pull request) ${{ matrix.dotnet }}
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can work.
- uses: dotnet/nbgv@master
with:
setAllVars: true
id: nbgv
name: install semantic versioning tool (nerdbank.gitversioning)
- run: echo 'SemVer2=${{ steps.nbgv.outputs.SemVer2 }}'
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Prep packages
run: dotnet nuget add source --username florianBachinger --password ${{ secrets.SPA_DAT_PackageDeployment_Token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/prescriptiveanalytics/index.json"
- name: dotnet build release
run: dotnet build src/Communication -c Release
- name: dotnet pack release
run: dotnet pack src/Communication -c Release
- name: publish every release to NuGet.org
run: dotnet nuget push src/Communication/bin/Release/*.nupkg -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads')
- name: dotnet build release
run: dotnet build src/Configuration -c Release
- name: dotnet pack release
run: dotnet pack src/Configuration -c Release
- name: publish every release to NuGet.org
run: dotnet nuget push src/Configuration/bin/Release/*.nupkg -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads')
- name: dotnet build release
run: dotnet build src/Utils -c Release
- name: dotnet pack release
run: dotnet pack src/Utils -c Release
- name: publish every release to NuGet.org
run: dotnet nuget push src/Utils/bin/Release/*.nupkg -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads')