Skip to content

Commit c2ecd8f

Browse files
authored
Merge pull request #11 from dotnet-campus/t/lindexi/LulergarwhawhurboLebinawkairyeehu
修改推Tag打包
2 parents 154a789 + cfbace1 commit c2ecd8f

File tree

2 files changed

+44
-34
lines changed

2 files changed

+44
-34
lines changed

.github/workflows/NuGet.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: publish nuget
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
11+
runs-on: windows-latest
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
16+
- name: Setup .NET Core
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: 3.1.300
20+
21+
- name: Install dotnet tool
22+
run: dotnet tool install -g dotnetCampus.TagToVersion
23+
24+
- name: Set tag to version
25+
run: dotnet TagToVersion -t ${{ github.ref }}
26+
27+
- name: Build with dotnet
28+
run: |
29+
dotnet build --configuration Release
30+
dotnet pack --configuration Release --no-build
31+
32+
- name: Install Nuget
33+
uses: nuget/setup-nuget@v1
34+
with:
35+
nuget-version: '5.x'
36+
37+
- name: Add private GitHub registry to NuGet
38+
run: |
39+
nuget sources add -name github -Source https://nuget.pkg.github.com/dotnet-campus/index.json -Username dotnet-campus -Password ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Push generated package to GitHub registry
42+
run: |
43+
nuget push .\bin\Release\*.nupkg -Source github -SkipDuplicate
44+
nuget push .\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} -NoSymbols

0 commit comments

Comments
 (0)