forked from w-ahmad/WinUI.TableView
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (73 loc) · 2.26 KB
/
ci-build.yml
File metadata and controls
85 lines (73 loc) · 2.26 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
name: ci-build
on:
push:
branches: main
paths-ignore:
- 'docs/**'
pull_request:
branches: main
paths-ignore:
- 'docs/**'
jobs:
build:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4.1.4
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v5.0.1
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Build
run: |
msbuild /restore `
/t:Build,Pack src/WinUI.TableView.csproj `
/p:Configuration=Release `
/p:Version=0.0.${{ github.run_number }}-dev
- name: Setup VSTest
uses: darenm/Setup-VSTest@v1.3
- name: Build Tests
run: |
msbuild /restore `
/t:Build tests/WinUI.TableView.Tests.csproj `
/p:Platform=x64 `
/p:Configuration=Release `
/p:OutputPath=build
- name: Run Tests
run: |
vstest.console.exe tests\build\WinUI.TableView.Tests.build.appxrecipe --logger:"console;verbosity=normal" /InIsolation
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: NuGet Packages
path: artifacts/NuGet/Release
publish:
needs: build
runs-on: windows-2022
environment: ci-nuget-publish
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: NuGet Packages
path: packages
- name: Push to NuGet
run: |
dotnet nuget push packages\*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
- name: Comment on PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const packageVersion = '0.0.${{ github.run_number }}-dev';
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `🚀 A NuGet package is now available to test these changes: https://www.nuget.org/packages/WinUI.TableView/${packageVersion}`
});