-
Notifications
You must be signed in to change notification settings - Fork 86
90 lines (71 loc) · 2.19 KB
/
ci.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
name: ci
on:
push:
branches: [ master ]
tags: [ v* ]
pull_request:
branches: [ master, develop ]
workflow_dispatch:
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1
NUGET_XMLDOC_MODE: skip
TERM: xterm
permissions:
contents: read
jobs:
build:
name: windows-latest
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
- name: Setup NuGet cache
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: windows-latest-nuget-${{ hashFiles('**/*.csproj', '**/*.props') }}
restore-keys: windows-latest-nuget-
- name: Build & Unit tests
shell: pwsh
run: ./build.ps1 --target=Run-Unit-Tests
- name: Package
shell: pwsh
run: ./build.ps1 --target=Package
- name: Publish NuGet package to Github actions cache
uses: actions/upload-artifact@v3
with:
name: packages-windows
path: ./artifacts
if-no-files-found: error
run-integration-tests:
runs-on: windows-latest
if: |
github.event.repository.fork == false &&
github.event.pull_request.head.ref == 'develop'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
- name: Run Integration tests
shell: pwsh
run: ./build.ps1 --target=Run-Integration-Tests --zendeskUrl=${{ secrets.ZENDESK_URL }} --zendeskUsername=${{ secrets.ZENDESK_USERNAME }} --zendeskToken=${{ secrets.ZENDESK_TOKEN }}
publish-nuget:
needs: build
runs-on: windows-latest
if: |
github.event.repository.fork == false &&
startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download packages
uses: actions/download-artifact@v3
with:
name: packages-windows
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
- name: Push NuGet packages to NuGet.org
run: dotnet nuget push "*.nupkg" --api-key ${{ secrets.NUGET_TOKEN }} --skip-duplicate --source https://api.nuget.org/v3/index.json