-
Notifications
You must be signed in to change notification settings - Fork 57
100 lines (91 loc) · 2.68 KB
/
Copy pathBuildAndPack.yml
File metadata and controls
100 lines (91 loc) · 2.68 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: BuildAndPack
on:
push:
branches:
- master
- main
tags:
- '*'
pull_request:
branches:
- '*'
jobs:
build-and-test:
strategy:
matrix:
include:
- os: windows
vm: windows-latest
- os: linux
vm: ubuntu-latest
- os: macos
vm: macos-15
env:
MSBuildEnableWorkloadResolver: false
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: "true"
name: ${{ matrix.os}}
runs-on: ${{ matrix.vm}}
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
10.0.x
9.0.x
8.0.x
7.0.x
6.0.x
3.1.x
2.1.x
# - run: dotnet new globaljson --sdk-version "8.0.402" --force
- name: Cache .nuke/temp, ~/.nuget/packages
uses: actions/cache@v3
with:
path: |
.nuke/temp
~/.nuget/packages
!~/.nuget/packages/netescapades.enumgenerators
!~/.nuget/packages/netescapades.enumgenerators.interceptors
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
# Use the ambient GitHub token to login to NuGet and retrieve an API key
- name: NuGet login (OIDC → temp API key)
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER || 'NOT_SET' }}
- name: Run './build.cmd Clean Test TestPackage PushToNuGet
run: ./build.cmd Clean GenerateReadmes Test TestPackage PushToNuGet
env:
NuGetToken: ${{ steps.login.outputs.NUGET_API_KEY || 'NOT_SET'}}
- uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.os}}
path: artifacts/packages
- uses: actions/upload-artifact@v4
with:
name: results-${{ matrix.os}}
path: artifacts/results
publish-test-results:
name: "Publish Tests Results"
needs: build-and-test
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write # needed unless run with comment_mode: off
# contents: read # only needed for private repository
# issues: read # only needed for private repository
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/results
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: "artifacts/**/*.trx"
json_thousands_separator: ","
check_run_annotations_branch: "*"