-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (68 loc) · 2.39 KB
/
Copy pathci.yml
File metadata and controls
83 lines (68 loc) · 2.39 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
name: CI
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
- 'feature/**'
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9'
- name: Dotnet information
run: dotnet --info
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4.0.0
with:
versionSpec: 6.5.x
- name: Determine Version
id: version
uses: gittools/actions/gitversion/execute@v4.0.0
- name: Install dependencies
run: dotnet restore
- name: Build
run: >
dotnet build --no-restore -c Release
/p:Version="${{steps.version.outputs.MajorMinorPatch}}"
/p:AssemblyVersion="${{steps.version.outputs.AssemblySemVer}}"
/p:AssemblyFileVersion="${{steps.version.outputs.AssemblySemFileVer}}"
/p:InformationalVersion="${{steps.version.outputs.InformationalVersion}}"
- name: Test
continue-on-error: true
run: dotnet test --no-build -c Release --logger trx --results-directory "./artifacts"
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: verify-test-results
path: |
**/*.received.*
- name: Process test reports
uses: im-open/process-dotnet-test-results@v2.2.5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
base-directory: './artifacts'
- name: Package
run: dotnet pack --no-build -c Release -o artifacts /p:Version="${{ steps.version.outputs.FullSemVer }}"
- name: Upload package to MyGet
if: startsWith(steps.version.outputs.PreReleaseLabel, 'rc-') || startsWith(steps.version.outputs.PreReleaseLabel, 'preview-')
run: dotnet nuget push "*.nupkg" -k ${{ secrets.MYGET_API_KEY }} -s https://www.myget.org/F/digillect/api/v3/index.json
working-directory: artifacts
- name: Upload package to NuGet
if: steps.version.outputs.PreReleaseTag == ''
run: dotnet nuget push "*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
working-directory: artifacts