-
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (65 loc) · 3.34 KB
/
dotnetpackage.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
name: .NET
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
env:
ProjectName: WebScale
runs-on: windows-latest
steps:
- name: Clone
uses: actions/[email protected]
- name: Initialize test reporting
uses: testspace-com/[email protected]
with:
domain: ${{github.repository_owner}}
- name: Restore
run: dotnet restore --verbosity normal
- name: Build
run: dotnet build --no-restore --configuration Release --verbosity normal
- name: Test
run: |
dotnet test --no-build --verbosity normal --configuration Release --collect:"XPlat Code Coverage" --settings Tests/Tests.runsettings --logger "trx;LogFileName=TestResults.xml"
Out-File -InputObject "TEST_EXIT_CODE=$LASTEXITCODE" -FilePath $env:GITHUB_ENV -Append -Encoding UTF8
Copy-Item Tests/TestResults/*/coverage.info Tests/TestResults -ErrorAction Continue
exit 0
- name: Upload test report
run: testspace Tests/TestResults/TestResults.xml
- name: Upload coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: Tests/TestResults/coverage.info
- name: Stop if tests failed
run: exit $env:TEST_EXIT_CODE
- name: Pack
run: dotnet pack ${{ env.ProjectName }} --no-build --configuration Release --verbosity normal
- name: Upload package
uses: actions/[email protected]
with:
name: ${{ env.ProjectName }}.nupkg
path: ${{ env.ProjectName }}/bin/Release/*.*nupkg
- name: Publish samples
run: |
dotnet publish Sample -c Release --self-contained false -p:PublishSingleFile=true -r win10-x64
dotnet publish Sample -c Release --self-contained false -p:PublishSingleFile=true -r win10-arm64
dotnet publish Sample -c Release --self-contained false -p:PublishSingleFile=true -r osx-x64
dotnet publish Sample -c Release --self-contained false -p:PublishSingleFile=true -r osx-arm64
dotnet publish Sample -c Release --self-contained false -p:PublishSingleFile=true -r linux-x64
dotnet publish Sample -c Release --self-contained false -p:PublishSingleFile=true -r linux-arm
New-Item -Name Sample/bin/Release/upload/Windows -Type Directory -ErrorAction SilentlyContinue
New-Item -Name Sample/bin/Release/upload/MacOS -Type Directory -ErrorAction SilentlyContinue
New-Item -Name Sample/bin/Release/upload/Linux -Type Directory -ErrorAction SilentlyContinue
Copy-Item Sample/bin/Release/net7.0/win10-x64/publish/Sample.exe Sample/bin/Release/upload/Windows/Sample-x64.exe
Copy-Item Sample/bin/Release/net7.0/win10-arm64/publish/Sample.exe Sample/bin/Release/upload/Windows/Sample-ARM64.exe
Copy-Item Sample/bin/Release/net7.0/osx-x64/publish/Sample Sample/bin/Release/upload/MacOS/Sample-x64
Copy-Item Sample/bin/Release/net7.0/osx-arm64/publish/Sample Sample/bin/Release/upload/MacOS/Sample-ARM64
Copy-Item Sample/bin/Release/net7.0/linux-x64/publish/Sample Sample/bin/Release/upload/Linux/Sample-x64
Copy-Item Sample/bin/Release/net7.0/linux-arm/publish/Sample Sample/bin/Release/upload/Linux/Sample-ARM
- name: Upload samples
uses: actions/[email protected]
with:
name: Samples
path: Sample/bin/Release/upload/