-
-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (64 loc) · 2.17 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
67
68
69
70
name: .NET
on: [push, pull_request]
env:
EXCLUDE_RUN_ID_FROM_PACKAGE: false
EXCLUDE_SUFFIX_FROM_VERSION: false
jobs:
# Build the whole Shmuelie.WinRTServer solution
build-solution:
strategy:
matrix:
configuration: [Debug, Release]
runs-on: windows-2022
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Setup NuGet
uses: nuget/setup-nuget@v1
- name: NuGet Restore
run: nuget restore
- name: Build
run: msbuild -t:restore,build /p:Configuration=${{matrix.configuration}} /p:Platform=x64 /bl
- name: Upload MSBuild binary log
uses: actions/upload-artifact@v3
with:
name: msbuild_log_${{matrix.configuration}}
path: msbuild.binlog
if-no-files-found: error
if: always()
# Build the only in Release to generate all the NuGet packages.
# This workflow also uploads the resulting packages as artifacts.
build-packages:
runs-on: windows-2022
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Setup NuGet
uses: nuget/setup-nuget@v1
- name: NuGet Restore
run: nuget restore
- name: Build
run: msbuild .\src\Shmuelie.WinRTServer\Shmuelie.WinRTServer.csproj -t:restore,build -p:Configuration=Release
- name: Pack
run: msbuild .\src\Shmuelie.WinRTServer\Shmuelie.WinRTServer.csproj -t:pack -p:Configuration=Release
- name: Upload package artifacts
uses: actions/upload-artifact@v3
with:
name: nuget_packages
path: artifacts\*.nupkg
if-no-files-found: error
# Publish the packages to GitHub packages
publish-nightlies-github:
needs: [build-solution, build-packages]
runs-on: windows-2022
if: ${{github.event_name == 'push'}}
steps:
- uses: actions/download-artifact@v3
with:
name: nuget_packages
path: artifacts
- run: dotnet nuget push "artifacts\*.nupkg" --source "https://nuget.pkg.github.com/${{github.repository_owner}}/index.json" --api-key ${{secrets.GITHUB_TOKEN}} --skip-duplicate