-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 2.14 KB
/
NuGet-Tag-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
58
59
60
61
62
63
64
65
66
67
68
name: Publish Custom WPF
on:
push:
tags:
- '*'
jobs:
# BuildDebug:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v1
# # - name: Install Nuget
# # uses: nuget/setup-nuget@v1
# # with:
# # nuget-version: '5.x'
# - name: Build
# run: .\build.cmd -pack -ci -configuration Debug -prepareMachine /p:Platform=x86
# - name: Push
# uses: actions/upload-artifact@v1
# with:
# name: WPF_Debug
# path: ./artifacts/packages/Debug/NonShipping
Build:
runs-on: [self-hosted, VSPreview] # 现在只有私有服务器才能打包成功
# runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
- name: Install Tools
run: dotnet tool install -g dotnetCampus.TagToVersion --add-source https://api.nuget.org/v3/index.json
- name: Set Package TagToVersion
run: dotnet tagtoversion -t ${{ github.ref }} -f CustomWpf\build\Version.props
- name: Build WPF
run: .\build.cmd -pack -ci -configuration Release -prepareMachine /p:Platform=x86
- name: Pack NuGet
run: dotnet pack CustomWpf -c release
- name: Install Nuget
uses: nuget/setup-nuget@v1
with:
nuget-version: '5.x'
# - name: Add private GitHub registry to NuGet
# run: |
# nuget sources add -name github -Source https://nuget.pkg.github.com/dotnet-campus/index.json -Username dotnet-campus -Password ${{ secrets.GITHUB_TOKEN }}
- name: Push NuGet Package
run: nuget push .\CustomWpf\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }}
# nuget push .\CustomWpf\bin\Release\*.nupkg -Source github -SkipDuplicate
# nuget push .\CustomWpf\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }}
# - name: Push
# uses: actions/upload-artifact@v1
# with:
# name: WPF_Release
# path: ./artifacts/packages/Release/NonShipping