-
Notifications
You must be signed in to change notification settings - Fork 28
36 lines (30 loc) · 944 Bytes
/
dotnet.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
name: master
on:
push:
branches:
- master
paths:
- 'Directory.Build.props'
jobs:
deploy-nuget:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [9.0.x] # 指定需要的 .NET 版本
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }} # 使用矩阵中的 .NET 版本
- name: Restore Dependencies
run: dotnet restore --configuration Release
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Pack
run: dotnet pack --no-build --configuration Release
- name: Push NuGet package
run: |
dotnet nuget push **/*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET }}
env:
NUGET_API_KEY: ${{ secrets.NUGET }}