forked from Grabacr07/VirtualDesktop
-
Notifications
You must be signed in to change notification settings - Fork 9
57 lines (44 loc) · 1.28 KB
/
publish.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
name: Publish
on:
push:
branches: [ main ]
env:
DOTNET_VERSION: 8.0.x
BUILD_TARGET: .\src\VirtualDesktop.sln
jobs:
build:
name: .NET Build
runs-on: windows-latest
if: "startsWith(github.event.head_commit.message, 'Release v')"
steps:
- uses: actions/checkout@v2
- name: Use .NET ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build
run: dotnet build ${{ env.BUILD_TARGET }} -c Release
- name: Pack
run: dotnet pack ${{ env.BUILD_TARGET }} -c Release --no-build
- name: Upload artifacts
uses: actions/[email protected]
with:
name: nuget-packages
path: "**/*.nupkg"
publish:
name: Publish to NuGet
runs-on: windows-latest
needs: build
if: "startsWith(github.event.head_commit.message, 'Release v')"
steps:
- name: Use NuGet
uses: NuGet/[email protected]
with:
nuget-version: latest
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
- name: Fetch artifacts
uses: actions/[email protected]
with:
name: nuget-packages
- name: Publish
run: nuget push **\*.nupkg -Source https://api.nuget.org/v3/index.json