-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (25 loc) · 1012 Bytes
/
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
name: Build and Publish NuGet Package
on:
push:
branches:
- master # 当在 main 分支上推送时触发构建
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x' # 指定要使用的 .NET 版本
- name: Add Github NuGet Repository
run: dotnet nuget add source --username ${{ secrets.USERNAME }} --password ${{ secrets.TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ secrets.NAMESPACE }}/index.json"
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release
- name: Pack NuGet package
run: dotnet pack --configuration Release --output nupkgs
- name: Publish NuGet package
run: dotnet nuget push nupkgs/GDUT.*.nupkg --source github --skip-duplicate