-
Notifications
You must be signed in to change notification settings - Fork 8
99 lines (92 loc) · 2.8 KB
/
build.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
name: Build
on:
push:
branches:
- main
pull_request:
release:
types:
- published
workflow_dispatch:
env:
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending .NET CLI telemetry to Microsoft.
DOTNET_CLI_TELEMETRY_OPTOUT: true
# Set the build number in MinVer.
MINVERBUILDMETADATA: build.${{github.run_number}}
jobs:
build:
name: pipeline-${{matrix.os}}-dotnet-${{matrix.dotnet-version}}
runs-on: ${{matrix.os}}
services:
hivemq:
image: hivemq/hivemq4:latest
ports:
- 1883:1883
- 8000:8000
- 8080:8080
options: >-
--health-cmd "curl -I http://localhost:8080/"
--health-interval 10s
--health-timeout 5s
--health-retries 10
--health-start-period 30s
strategy:
matrix:
# Docker containers not supported on windows and macOS in Github runners.
# os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest]
dotnet-version: ['6.0.x', '7.0.x', '8.0.x']
steps:
- name: "Checkout"
uses: actions/[email protected]
with:
lfs: true
fetch-depth: 0
- name: "Install .NET Core SDK"
uses: actions/setup-dotnet@v4
with:
dotnet-version: '${{ matrix.dotnet-version }}'
- name: "Dotnet Tool Restore"
run: dotnet tool restore
shell: pwsh
- name: "Dotnet Cake Build"
run: dotnet cake --target=Build
shell: pwsh
- name: "Dotnet Cake Test"
run: dotnet cake --target=Test
shell: pwsh
- name: "Dotnet Cake Pack"
run: dotnet cake --target=Pack
shell: pwsh
- name: "Upload NuGet packages"
uses: actions/upload-artifact@v4
with:
name: nuget-packages-${{ matrix.dotnet-version }}
path: ./Artifacts/*.nupkg
publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: "Download NuGet packages"
uses: actions/download-artifact@v4
with:
name: nuget-packages-6.0.x
path: ./Artifacts
- name: "Download NuGet packages"
uses: actions/download-artifact@v4
with:
name: nuget-packages-7.0.x
path: ./Artifacts
- name: "Download NuGet packages"
uses: actions/download-artifact@v4
with:
name: nuget-packages-8.0.x
path: ./Artifacts
- name: Push to NuGet
if: github.event_name == 'release'
run: dotnet nuget push ./Artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
shell: pwsh