Skip to content

Commit 47090b3

Browse files
authored
Update GitHub Actions workflow for .NET build and release
1 parent bf1cbfd commit 47090b3

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/dotnet.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build & Release SLDataAPI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
runs-on: windows-latest
14+
15+
steps:
16+
- name: 📥 Checkout 仓库
17+
uses: actions/checkout@v4
18+
19+
- name: 🧰 设置 MSBuild
20+
uses: microsoft/setup-msbuild@v2
21+
22+
- name: 📦 安装 NuGet
23+
uses: NuGet/setup-nuget@v2
24+
25+
- name: 📦 还原依赖
26+
run: dotnet restore
27+
28+
- name: 🛠 编译项目
29+
run: msbuild SLDataAPI.csproj /p:Configuration=Release
30+
31+
- name: 📂 查找 DLL
32+
id: find_dll
33+
run: |
34+
$dll = Get-ChildItem -Recurse -Filter "*.dll" | Where-Object { $_.Name -eq "SLDataAPI.dll" } | Select-Object -First 1
35+
echo "dll_path=$($dll.FullName)" >> $env:GITHUB_OUTPUT
36+
37+
- name: 🏷 获取版本号
38+
id: version
39+
run: |
40+
$version = "v1.0.$(Get-Date -Format yyyyMMddHHmmss)"
41+
echo "version=$version" >> $env:GITHUB_OUTPUT
42+
43+
- name: 🚀 创建 Release
44+
uses: softprops/action-gh-release@v2
45+
with:
46+
tag_name: ${{ steps.version.outputs.version }}
47+
name: DeepSeekBot ${{ steps.version.outputs.version }}
48+
files: ${{ steps.find_dll.outputs.dll_path }}
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)