-
Notifications
You must be signed in to change notification settings - Fork 13
100 lines (92 loc) · 2.91 KB
/
dotnetcore.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
98
99
100
name: .NET Core CI/CD
on:
push:
branches:
- master
tags:
- v*
paths:
- '**'
- '!**.md'
pull_request:
paths:
- '**'
- '!**.md'
jobs:
build:
name: Build & Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
configuration: [ Debug, Release ]
include:
- os: ubuntu-latest
configuration: Release
is-main: true
- os: windows-latest
configuration: Release
is-netfx: true
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
# COMPlus_EnableAVX: 0
# COMPlus_EnableSSE: 0
DYLD_FALLBACK_LIBRARY_PATH: /usr/local/Cellar/[email protected]/
steps:
- uses: actions/checkout@v4
# - name: Setup OpenSSL (macOS)
# if: matrix.os == 'macos-latest'
# run: |
# ln -s /usr/local/opt/[email protected]/lib/libssl.1.1.dylib /usr/local/lib/libssl.1.1.dylib
# ln -s /usr/local/opt/[email protected]/lib/libcrypto.1.1.dylib /usr/local/lib/libcrypto.1.1.dylib
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.x
7.x
8.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c ${{ matrix.configuration }} --no-restore
- name: Test
# disable macOS tests
if: matrix.os != 'macos-latest'
run: dotnet test -c ${{ matrix.configuration }} --no-build --collect:"XPlat Code Coverage" --settings coverlet.runsettings
- name: Upload coverage to Codecov
if: matrix.is-netfx
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Creates NuGet packages
if: matrix.is-main
run: dotnet pack -c ${{ matrix.configuration }} --output=nuget_packed --no-build
- name: Upload NuGet packages to Artifacts
if: matrix.is-main
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: |
nuget_packed/*.nupkg
nuget_packed/*.snupkg
publish:
name: Publish packages
if: contains(github.ref, 'tags/v')
needs: [build]
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- name: Download generated NuGet packages
uses: actions/download-artifact@v2
with:
name: nuget-packages
- name: Push packages to api.nuget.org
run: dotnet nuget push **/*.nupkg --api-key=${{ secrets.NUGET_APIKEY }} --source=https://api.nuget.org/v3/index.json --skip-duplicate