-
Notifications
You must be signed in to change notification settings - Fork 106
143 lines (116 loc) · 3.83 KB
/
ci.yml
File metadata and controls
143 lines (116 loc) · 3.83 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: CI Build
on:
push:
pull_request:
jobs:
build-windows:
runs-on: windows-latest
strategy:
matrix:
configuration: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Restore dependencies
run: dotnet restore OpenGL.Net.sln
- name: Build
run: dotnet build OpenGL.Net.sln --configuration ${{ matrix.configuration }} --no-restore
- name: Test
run: dotnet test OpenGL.Net.sln --configuration ${{ matrix.configuration }} --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
continue-on-error: true
- name: Upload coverage reports to Codecov
if: matrix.configuration == 'Debug'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/**/coverage.cobertura.xml
flags: windows
name: windows-coverage
fail_ci_if_error: false
- name: Upload coverage artifacts
if: matrix.configuration == 'Debug'
uses: actions/upload-artifact@v4
with:
name: coverage-report-windows-${{ matrix.configuration }}
path: ./coverage/**/coverage.cobertura.xml
retention-days: 30
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
configuration: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Restore dependencies
run: dotnet restore OpenGL.Net.sln
- name: Build
run: dotnet build OpenGL.Net.sln --configuration ${{ matrix.configuration }} --no-restore
- name: Test
run: dotnet test OpenGL.Net.sln --configuration ${{ matrix.configuration }} --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
continue-on-error: true
- name: Upload coverage reports to Codecov
if: matrix.configuration == 'Debug'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/**/coverage.cobertura.xml
flags: linux
name: linux-coverage
fail_ci_if_error: false
- name: Upload coverage artifacts
if: matrix.configuration == 'Debug'
uses: actions/upload-artifact@v4
with:
name: coverage-report-linux-${{ matrix.configuration }}
path: ./coverage/**/coverage.cobertura.xml
retention-days: 30
build-macos:
runs-on: macos-latest
strategy:
matrix:
configuration: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Restore dependencies
run: dotnet restore OpenGL.Net.sln
- name: Build
run: dotnet build OpenGL.Net.sln --configuration ${{ matrix.configuration }} --no-restore
deploy:
runs-on: windows-latest
needs: [build-windows, build-linux, build-macos]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Restore dependencies
run: dotnet restore OpenGL.Net.sln
- name: Pack
run: dotnet pack OpenGL.Net.sln --configuration Release --no-restore --output nupkgs
- name: Publish to NuGet
run: dotnet nuget push nupkgs\*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate