Skip to content

Commit dadbefe

Browse files
committed
fix: deploy nuget
1 parent 4bb7957 commit dadbefe

File tree

1 file changed

+34
-22
lines changed

1 file changed

+34
-22
lines changed

.github/workflows/Release.yml

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,41 @@
11
name: Release
22

33
on:
4-
release:
5-
types:
4+
release:
5+
types:
66
- published
77

88
jobs:
9-
publish-nuget:
10-
runs-on: windows-latest
9+
publish-core:
10+
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
13-
- name: Setup .NET
14-
uses: actions/setup-dotnet@v4
15-
with:
16-
dotnet-version: 8.0.x
17-
cache: false
18-
- name: Restore
19-
run: dotnet restore MbSoftLab.TemplateEngine.Core.sln
20-
- name: Build
21-
run: dotnet build MbSoftLab.TemplateEngine.Core.sln --configuration Release --no-restore
22-
- name: Pack Core and Razor projects
23-
run: |
24-
dotnet pack MbSoftLab.TemplateEngine.Core/MbSoftLab.TemplateEngine.Core.csproj --configuration Release --no-restore
25-
dotnet pack MbSoftLab.TemplateEngine.Core.Razor/MbSoftLab.TemplateEngine.Core.Razor.csproj --configuration Release --no-restore
26-
- name: Push Core package to NuGet
27-
run: dotnet nuget push MbSoftLab.TemplateEngine.Core/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
28-
- name: Push Razor package to NuGet
29-
run: dotnet nuget push MbSoftLab.TemplateEngine.Core.Razor/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
12+
- uses: actions/checkout@v4
13+
- name: Setup .NET
14+
uses: actions/setup-dotnet@v4
15+
with:
16+
dotnet-version: 8.0.x
17+
- name: Restore
18+
run: dotnet restore MbSoftLab.TemplateEngine.Core/MbSoftLab.TemplateEngine.Core.csproj
19+
- name: Build
20+
run: dotnet build MbSoftLab.TemplateEngine.Core/MbSoftLab.TemplateEngine.Core.csproj --configuration Release --no-restore
21+
- name: Pack
22+
run: dotnet pack MbSoftLab.TemplateEngine.Core/MbSoftLab.TemplateEngine.Core.csproj --configuration Release --no-restore
23+
- name: Publish to NuGet
24+
run: dotnet nuget push MbSoftLab.TemplateEngine.Core/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
25+
26+
publish-razor:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Setup .NET
31+
uses: actions/setup-dotnet@v4
32+
with:
33+
dotnet-version: 8.0.x
34+
- name: Restore
35+
run: dotnet restore MbSoftLab.TemplateEngine.Core.Razor/MbSoftLab.TemplateEngine.Core.Razor.csproj
36+
- name: Build
37+
run: dotnet build MbSoftLab.TemplateEngine.Core.Razor/MbSoftLab.TemplateEngine.Core.Razor.csproj --configuration Release --no-restore
38+
- name: Pack
39+
run: dotnet pack MbSoftLab.TemplateEngine.Core.Razor/MbSoftLab.TemplateEngine.Core.Razor.csproj --configuration Release --no-restore
40+
- name: Publish to NuGet
41+
run: dotnet nuget push MbSoftLab.TemplateEngine.Core.Razor/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)