-
Notifications
You must be signed in to change notification settings - Fork 6
97 lines (80 loc) · 2.53 KB
/
Release.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Build & Deploy Tagged Releases
on:
release:
types: [published]
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
ContinuousIntegrationBuild: true
BuildType: tagged
jobs:
build:
name: Build & Test
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Setup Dotnet for use with actions
uses: actions/setup-dotnet@v1
- name: Test
run: dotnet test -c Release -p:EnableCoverage=true
- name: Upload Code Coverage
uses: codecov/codecov-action@v2
with:
files: out/coverage/**/*.opencover.xml
if: ${{ always() }}
- name: Upload TestResults
uses: actions/upload-artifact@v2
with:
name: TestResults & Coverage
path: |
out/coverage/
out/testresults/*.trx
if: ${{ always() }}
- name: Pack
run: dotnet pack -c Release
- name: Upload Packages
uses: actions/upload-artifact@v2
with:
name: packages
path: out/packages/*.nupkg
deploy-to-gpr:
name: Deploy to GPR
needs: [ build ]
runs-on: ubuntu-latest
environment:
name: GPR
url: https://github.com/MeikTranel/NXPorts/packages
env:
GPR_REPOURI: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
steps:
- uses: actions/checkout@v1
- uses: actions/download-artifact@v2
name: Download Packages from build job
with:
name: packages
path: out/packages/
- name: Setup Dotnet for use with actions
uses: actions/setup-dotnet@v1
- name: Publish CI Package to GitHub Package Registry
run: |
dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name GPR "${{env.GPR_REPOURI}}"
dotnet nuget push "*.nupkg" --source GPR
working-directory: out/packages/
deploy-to-nuget-gallery:
name: Deploy to NuGet Gallery
needs: [ build ]
runs-on: ubuntu-latest
environment:
name: NuGet Gallery
url: https://www.nuget.org/packages/NXPorts/
steps:
- uses: actions/checkout@v1
- uses: actions/download-artifact@v2
name: Download Packages from build job
with:
name: packages
path: out/packages/
- name: Setup Dotnet for use with actions
uses: actions/setup-dotnet@v1
- name: Publish CI Package to NuGet Gallery
run: dotnet nuget push "*.nupkg" -k ${{ secrets.NUGETGALLERY_NXPORTS_SECRET }} -s https://api.nuget.org/v3/index.json
working-directory: out/packages/