-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (72 loc) · 2.73 KB
/
dotnet.yml
File metadata and controls
78 lines (72 loc) · 2.73 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
name: .NET
on:
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '8.0.x', '9.0.x', '10.0.x' ]
steps:
- uses: actions/checkout@v4
- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
id: stepid
with:
dotnet-version: ${{ matrix.dotnet-version }}
# - name: Create temporary global.json
# run: echo '{"sdk":{"version":"${{ steps.stepid.outputs.dotnet-version }}"}}' > ./global.json
- name: Display dotnet version
run: dotnet --version
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
timeout-minutes: 2
run: dotnet test --no-build
- name: Pack NuGet packages (PR validation)
if: matrix.dotnet-version == '8.0.x'
run: |
dotnet pack Activout.RestClient/Activout.RestClient.csproj \
-p:PackageVersion=1.0.0-pr${{ github.event.pull_request.number }}.${{ github.run_number }} \
--configuration=Release \
--no-build \
--include-symbols \
--include-source
dotnet pack Activout.RestClient.Json/Activout.RestClient.Json.csproj \
-p:PackageVersion=1.0.0-pr${{ github.event.pull_request.number }}.${{ github.run_number }} \
--configuration=Release \
--no-build \
--include-symbols \
--include-source
dotnet pack Activout.RestClient.Newtonsoft.Json/Activout.RestClient.Newtonsoft.Json.csproj \
-p:PackageVersion=1.0.0-pr${{ github.event.pull_request.number }}.${{ github.run_number }} \
--configuration=Release \
--no-build \
--include-symbols \
--include-source
dotnet pack Activout.RestClient.Xml/Activout.RestClient.Xml.csproj \
-p:PackageVersion=1.0.0-pr${{ github.event.pull_request.number }}.${{ github.run_number }} \
--configuration=Release \
--no-build \
--include-symbols \
--include-source
- name: Upload NuGet packages
if: matrix.dotnet-version == '8.0.x'
uses: actions/upload-artifact@v4
with:
name: nuget-packages-pr${{ github.event.pull_request.number }}-run${{ github.run_number }}
path: |
**/*.nupkg
**/*.snupkg
# - name: Archive test results
# uses: actions/upload-artifact@v4
# if: always()
# with:
# name: TestResults
# path: |
# /home/runner/work/Activout.RestClient/Activout.RestClient/Activout.RestClient.Test/TestResults/