forked from thomhurst/TUnit
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (56 loc) · 1.81 KB
/
dotnet.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
name: .NET
on:
push: {}
pull_request: {}
workflow_dispatch:
inputs:
publish-packages:
description: Publish packages?
type: boolean
required: true
jobs:
modularpipeline:
environment: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Pull Requests' }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.401
- name: Clear NuGet Cache
run: dotnet nuget locals all --clear
- name: Restore Packages
run: |
for i in {1..3}; do
dotnet restore && break || sleep 10;
done
- name: Build
run: dotnet build -c Release
- name: Run Pipeline
run: dotnet run -c Release
working-directory: "TUnit.Pipeline"
env:
ADMIN_TOKEN: ${{ secrets.ADMIN_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
DOTNET_ENVIRONMENT: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Development' }}
NuGet__ApiKey: ${{ secrets.NUGET__APIKEY }}
NuGet__ShouldPublish: ${{ (github.event.inputs.publish-packages || false) && matrix.os == 'ubuntu-latest' }}
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.4.0
if: always()
with:
name: TestingPlatformDiagnosticLogs${{matrix.os}}
path: '**/log_*.diag'
- name: NuGet Packages Artifacts
uses: actions/upload-artifact@v4.4.0
if: always()
with:
name: NuGetPackages${{matrix.os}}
path: '**/*.*nupkg'