Skip to content

Commit 734a855

Browse files
Set up NuGet trusted publishing. (#584)
* Set up NuGet trusted publishing. * Use environment variable for NuGet feed.
1 parent 51b7efc commit 734a855

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
Run-Tests:
99
uses: ./.github/workflows/tiledb-csharp.yml
10-
Release:
10+
Pack:
1111
runs-on: ubuntu-latest
1212
needs: Run-Tests
1313
steps:
@@ -23,9 +23,31 @@ jobs:
2323
uses: actions/upload-artifact@v4
2424
with:
2525
name: nuget-release
26-
path: pack/
26+
path: ./pack
27+
Release:
28+
runs-on: ubuntu-latest
29+
needs: Pack
30+
environment: release
31+
permissions:
32+
id-token: write
33+
steps:
34+
- uses: actions/checkout@v5
35+
- uses: actions/setup-dotnet@v5
36+
with:
37+
dotnet-version: 8.0.4xx
38+
- name: Obtain NuGet API token
39+
uses: nuget/login@v1
40+
id: nuget-login
41+
with:
42+
user: ${{ vars.NUGET_USER }}
43+
if: vars.NUGET_USER != ''
44+
- name: Download package artifacts
45+
uses: actions/download-artifact@v4
46+
with:
47+
name: nuget-release
48+
path: ./pack
2749
- name: Push packages to NuGet
2850
shell: bash
2951
run: |
3052
cd pack
31-
dotnet nuget push "*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ secrets.TILEDB_CSHARP_NUGET_KEY }}
53+
dotnet nuget push "*.nupkg" -s ${{ vars.NUGET_FEED }} -k ${{ steps.nuget-login.outputs.NUGET_API_KEY || secrets.NUGET_KEY }}

0 commit comments

Comments
 (0)