Skip to content

Commit 33d9d98

Browse files
committed
chore: update action for net9
1 parent 58180ef commit 33d9d98

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/pack9.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Package to Nuget
2+
3+
on:
4+
push:
5+
branches:
6+
- pack
7+
- release
8+
- hotfix
9+
- action
10+
11+
jobs:
12+
pack:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
id-token: write
16+
contents: read
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Setup .NET Core SDK
22+
uses: actions/setup-dotnet@v4
23+
with:
24+
dotnet-version: 9.0.x
25+
26+
- name: Cache NuGet packages
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/.nuget/packages
30+
key: ${{runner.os}}-nuget-bb-${{hashFiles('**/*.csproj')}}
31+
restore-keys: |
32+
${{runner.os}}-nuget-bb-
33+
34+
- name: Restore dependencies
35+
run: dotnet restore src/BootstrapBlazor
36+
37+
- name: NuGet login
38+
uses: NuGet/login@v1
39+
id: login
40+
with:
41+
user: ${{ secrets.NUGET_USER }}
42+
43+
- name: Publish to Nuget
44+
env:
45+
NUGET_API_KEY: ${{steps.login.outputs.NUGET_API_KEY}}
46+
Bundle: True
47+
48+
run: |
49+
dotnet build src/BootstrapBlazor
50+
dotnet pack src/BootstrapBlazor -c Release -o publish
51+
dotnet nuget push publish/BootstrapBlazor.*.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY --skip-duplicate

0 commit comments

Comments
 (0)