Skip to content

Commit 9b305da

Browse files
committed
[增加]1. 增加自动化构建推送的流水线
1 parent 317d294 commit 9b305da

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/publish-nuget.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish NuGet
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Setup .NET Core
16+
uses: actions/setup-dotnet@v1
17+
with:
18+
dotnet-version: 8.0.300
19+
20+
- name: Install dotnet tool
21+
run: dotnet tool install -g dotnetCampus.TagToVersion
22+
23+
- name: Set tag to version
24+
run: dotnet TagToVersion -t ${{ github.ref }} -f Version.props
25+
26+
- name: Install dependencies
27+
run: dotnet restore
28+
29+
- name: Build
30+
run: dotnet build --configuration Release --no-restore
31+
32+
- name: Publish To Nuget
33+
run: dotnet nuget push ./bin/app/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)