-
-
Notifications
You must be signed in to change notification settings - Fork 4
79 lines (66 loc) · 2.08 KB
/
build.yml
File metadata and controls
79 lines (66 loc) · 2.08 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
name: 🛠️ build
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-**"
pull_request:
types: [opened, reopened, edited, syncrhonize]
jobs:
test:
name: 🧪 Run tests
runs-on: ubuntu-latest
strategy:
matrix:
roslyn: ["3.11", "4.0", "4.4"]
steps:
- name: 🛒 Check-out code
uses: actions/checkout@v4
- name: 📐 Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: src/global.json
- name: 🔍 Enable problem matchers
run: echo "::add-matcher::.github/matchers/dotnet.json"
- name: 🛠️ Build code
run: dotnet build --configuration Release
- name: 🧪 Testing ${{ matrix.roslyn }} code
run: >
dotnet test
--configuration Release
-p:GeneratorVersion=${{ matrix.roslyn }}
--logger GitHubActions
--
RunConfiguration.CollectSourceInformation=true
- name: Upload Test Results
if: failure()
uses: actions/upload-artifact@v4
with:
name: verify-test-results
path: |
**/*.received.*
build:
name: 🛠️ Build
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
runs-on: ubuntu-latest
needs: test
steps:
- name: 🛒 Check-out code
uses: actions/checkout@v4
- name: 📐 Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: src/global.json
- name: 🔍 Enable problem matchers
run: echo "::add-matcher::.github/matchers/dotnet.json"
- name: 🔧 Load packages
run: dotnet restore
- name: 🛠️ Build code
run: dotnet build --configuration Release -p:Version=${{ github.ref_name }} -p:GitSha=${{ github.sha }} --no-restore
- name: 📝 Generate Release Notes
run: gh release create ${{ github.ref_name }} --draft --generate-notes nugets/*.nupkg
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}