Skip to content

Commit b03710f

Browse files
authored
ci: Use trusted publishing (#65)
1 parent 52828f9 commit b03710f

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
runs-on: ubuntu-latest
3535
permissions:
3636
contents: write
37+
id-token: write
3738

3839
env:
3940
PACKAGES_OUTPUT_DIR: ${{ github.workspace }}/packages
@@ -88,19 +89,17 @@ jobs:
8889
-p:PackageVersion="${VERSION}"
8990
ls -l "${PACKAGES_OUTPUT_DIR}"
9091
92+
- name: NuGet login
93+
uses: NuGet/login@v1
94+
id: nuget-login
95+
with:
96+
user: paradedb
97+
9198
- name: Publish to NuGet
92-
env:
93-
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
9499
run: |
95100
set -euo pipefail
96-
97-
if [[ -z "${NUGET_API_KEY:-}" ]]; then
98-
echo "Missing NuGet secret (NUGET_API_KEY)"
99-
exit 1
100-
fi
101-
102101
dotnet nuget push "${PACKAGES_OUTPUT_DIR}"/*.nupkg \
103-
--api-key "${NUGET_API_KEY}" \
102+
--api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" \
104103
--source https://api.nuget.org/v3/index.json
105104
106105
- name: Create GitHub tag and release

0 commit comments

Comments
 (0)