Skip to content

Commit 02c7b64

Browse files
committed
feat: update publish nuget file
1 parent 5eba6ae commit 02c7b64

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

.github/workflows/publish-nuget.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ on:
2222
required: false
2323
type: string
2424

25+
permissions:
26+
id-token: write # required for GitHub OIDC
27+
2528
jobs:
2629
build:
2730
runs-on: ubuntu-latest
@@ -42,7 +45,7 @@ jobs:
4245
- name: Setup .NET
4346
uses: actions/setup-dotnet@v4
4447
with:
45-
dotnet-version: 9.0.x
48+
dotnet-version: 10.0.x
4649

4750
- name: Restore dependencies
4851
run: dotnet restore src/Base58Encoding.slnx
@@ -71,6 +74,7 @@ jobs:
7174
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.version != '')
7275
permissions:
7376
contents: write
77+
id-token: write # enable GitHub OIDC token issuance for this job
7478

7579
steps:
7680
- name: Download artifacts
@@ -80,12 +84,18 @@ jobs:
8084
path: ./artifacts
8185

8286
- name: Setup .NET
83-
uses: actions/setup-dotnet@v4
87+
uses: actions/setup-dotnet@v5
88+
with:
89+
dotnet-version: 10.0.x
90+
91+
- name: NuGet login (OIDC → temp API key)
92+
uses: NuGet/login@v1
93+
id: login
8494
with:
85-
dotnet-version: 9.0.x
95+
user: ${{ secrets.NUGET_USER }}
8696

8797
- name: Publish to NuGet
88-
run: dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
98+
run: dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --skip-duplicate
8999

90100
- name: Create GitHub Release
91101
uses: softprops/action-gh-release@v2

src/Base58Encoding/Base58.Decode.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using System;
21
using System.Buffers.Binary;
3-
using System.Collections.Generic;
4-
using System.Linq;
5-
using System.Text;
6-
using System.Threading.Tasks;
72

83
namespace Base58Encoding;
94

0 commit comments

Comments
 (0)