Skip to content

Commit 9d9e4fb

Browse files
committed
修改自动化
1 parent 479ec03 commit 9d9e4fb

File tree

6 files changed

+57
-5
lines changed

6 files changed

+57
-5
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: publish-nuget
2-
run-name: 发布nuget包,版本:${{ github.ref_name }}
2+
run-name: 发布Core nuget包,版本:${{ github.ref_name }}
33

44
on:
55
push:
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: publish-nuget-di
2+
run-name: 发布DI nuget包,版本:${{ github.ref_name }}
3+
4+
on:
5+
push:
6+
tags:
7+
- "*"
8+
9+
jobs:
10+
publish-nuget-packages:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
packages: write
14+
contents: read
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
lfs: true
19+
- name: 安装.NET
20+
uses: actions/setup-dotnet@v3
21+
with:
22+
dotnet-version: 9.0.x
23+
- name: 恢复依赖
24+
run: dotnet restore ./NapPlana.Net.DI/NapPlana.Net.DI.csproj
25+
- name: 获取tag
26+
id: version
27+
shell: bash
28+
run: |
29+
ref="${GITHUB_REF_NAME}"
30+
# Strip leading 'v' if present (e.g., v1.2.3 -> 1.2.3)
31+
if [[ "$ref" == v* ]]; then
32+
ref="${ref#v}"
33+
fi
34+
echo "PACKAGE_VERSION=$ref" >> "$GITHUB_ENV"
35+
echo "package_version=$ref" >> "$GITHUB_OUTPUT"
36+
- name: 构建
37+
run: dotnet build --no-restore -c Release ./NapPlana.Net.DI/NapPlana.Net.DI.csproj
38+
- name: 创建软件包
39+
run: dotnet pack --no-build -c Release -p:PackageVersion=${{ env.PACKAGE_VERSION }} ./NapPlana.Net.DI/NapPlana.Net.DI.csproj
40+
- name: 添加nuget源
41+
run: dotnet nuget add source --username stevesensei --password ${{ secrets.TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/napplana/index.json"
42+
- name: 推送到github packages
43+
run: dotnet nuget push ./NapPlana.Net.DI/bin/Release/*.nupkg --api-key ${{ secrets.TOKEN }} --source github --skip-duplicate
44+
- name: 推送到nuget
45+
run: dotnet nuget push ./NapPlana.Net.DI/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_GALLERY_TOKEN }} --source nuget.org --skip-duplicate

NapPlana.NET.DI/NapPlana.NET.DI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Nullable>enable</Nullable>
77
<RootNamespace>NapPlana.DI</RootNamespace>
88
<Version>0.0.1</Version>
9-
<Title>NapPlana.NET.DI</Title>
9+
<Title>NapPlana.Net.DI</Title>
1010
<Authors>stevesensei</Authors>
1111
<Description>A dependency injection implementation for NapPlana</Description>
1212
<Copyright>CopyRight © 2026 stevesensei All Rights.</Copyright>

NapPlana.NET.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 18
4+
VisualStudioVersion = 18.3.11505.172 d18.3
5+
MinimumVisualStudioVersion = 10.0.40219.1
36
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NapPlana.Net.Example", "NapPlana.Net.Example\NapPlana.Net.Example.csproj", "{F0443E98-53BB-4ED2-BA19-F054CF34F79B}"
47
EndProject
58
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NapPlana.Net.Core", "NapPlana.Net.Core\NapPlana.Net.Core.csproj", "{41E4EB08-7498-4797-AB63-C92029CADBB4}"
69
EndProject
710
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{A12BF739-4C7F-4B74-BB0D-7DA8040264B0}"
811
EndProject
9-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NapPlana.NET.DI", "NapPlana.NET.DI\NapPlana.NET.DI.csproj", "{FDCAB45D-8EC8-4A3F-B1BF-0D024CC28FCA}"
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NapPlana.Net.DI", "NapPlana.Net.DI\NapPlana.Net.DI.csproj", "{FDCAB45D-8EC8-4A3F-B1BF-0D024CC28FCA}"
1013
EndProject
1114
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NapPlana.Net.DiExample", "NapPlana.Net.DiExample\NapPlana.Net.DiExample.csproj", "{CE05AB30-9589-4F3C-B3E9-BDACC56F5851}"
1215
EndProject
@@ -33,6 +36,9 @@ Global
3336
{CE05AB30-9589-4F3C-B3E9-BDACC56F5851}.Release|Any CPU.ActiveCfg = Release|Any CPU
3437
{CE05AB30-9589-4F3C-B3E9-BDACC56F5851}.Release|Any CPU.Build.0 = Release|Any CPU
3538
EndGlobalSection
39+
GlobalSection(SolutionProperties) = preSolution
40+
HideSolutionNode = FALSE
41+
EndGlobalSection
3642
GlobalSection(NestedProjects) = preSolution
3743
{F0443E98-53BB-4ED2-BA19-F054CF34F79B} = {A12BF739-4C7F-4B74-BB0D-7DA8040264B0}
3844
{CE05AB30-9589-4F3C-B3E9-BDACC56F5851} = {A12BF739-4C7F-4B74-BB0D-7DA8040264B0}

NapPlana.Net.DiExample/NapPlana.Net.DiExample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<ItemGroup>
1111
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
1212
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
13-
<ProjectReference Include="..\NapPlana.NET.DI\NapPlana.NET.DI.csproj" />
13+
<ProjectReference Include="..\NapPlana.NET.DI\NapPlana.Net.DI.csproj" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

api-doc/Doxyfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,8 @@ WARN_LOGFILE =
10051005
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
10061006
# Note: If this tag is empty the current directory is searched.
10071007

1008-
INPUT = ../NapPlana.Net.Core
1008+
INPUT = ../NapPlana.Net.Core \
1009+
../NapPlana.Net.DI
10091010

10101011
# This tag can be used to specify the character encoding of the source files
10111012
# that Doxygen parses. Internally Doxygen uses the UTF-8 encoding. Doxygen uses

0 commit comments

Comments
 (0)