瀏覽代碼

Create nuget.yaml

tags/v2.7.0
yedajiang44 9 月之前
committed by GitHub
父節點
當前提交
e79d18c3b4
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: B5690EEEBB952194
共有 1 個檔案被更改,包括 33 行新增0 行删除
  1. +33
    -0
      .github/workflows/nuget.yaml

+ 33
- 0
.github/workflows/nuget.yaml 查看文件

@@ -0,0 +1,33 @@
name: Publish NuGet Package

on:
push:
tags:
- 'v*' # 触发条件为推送符合 v* 格式的标签,例如 v1.0.0

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.203'

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Pack NuGet package
run: dotnet pack --configuration Release --no-build --output ./output

- name: Publish to NuGet
run: dotnet nuget push ./output/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

Loading…
取消
儲存