Skip to content

Commit d28cda3

Browse files
authored
chore(Action): add net9 pack action (#6989)
* chore: update action for net9 * refactor: 更新 C# 版本 * refactor: 更新 action * chore: 删除 action 分支
1 parent 58180ef commit d28cda3

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

.github/workflows/pack.yml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,48 @@ on:
88
- hotfix
99

1010
jobs:
11-
pack:
11+
NET9:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
id-token: write
15+
contents: read
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup .NET Core SDK
21+
uses: actions/setup-dotnet@v4
22+
with:
23+
dotnet-version: 9.0.x
24+
25+
- name: Cache NuGet packages
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.nuget/packages
29+
key: ${{runner.os}}-nuget-bb-${{hashFiles('**/*.csproj')}}
30+
restore-keys: |
31+
${{runner.os}}-nuget-bb-
32+
33+
- name: Restore dependencies
34+
run: dotnet restore src/BootstrapBlazor
35+
36+
- name: NuGet login
37+
uses: NuGet/login@v1
38+
id: login
39+
with:
40+
user: ${{ secrets.NUGET_USER }}
41+
42+
- name: Publish to Nuget
43+
env:
44+
NUGET_API_KEY: ${{steps.login.outputs.NUGET_API_KEY}}
45+
Bundle: True
46+
47+
run: |
48+
dotnet build src/BootstrapBlazor
49+
dotnet pack src/BootstrapBlazor -c Release -o publish
50+
dotnet nuget push publish/BootstrapBlazor.*.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY --skip-duplicate
51+
52+
NET10:
1253
runs-on: ubuntu-latest
1354
permissions:
1455
id-token: write

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<PropertyGroup>
14-
<LangVersion>latest</LangVersion>
14+
<LangVersion>preview</LangVersion>
1515
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
1616
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
1717
</PropertyGroup>

0 commit comments

Comments
 (0)