Skip to content

fix: use correct GitHub Actions variables for RepositoryUrl #9

fix: use correct GitHub Actions variables for RepositoryUrl

fix: use correct GitHub Actions variables for RepositoryUrl #9

Workflow file for this run

name: Publish to NuGet
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version to publish (without v prefix)'
required: true
permissions:
contents: read
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: true
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
dotnet-quality: 'preview'
- name: Determine version
id: version
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
fi
- name: Build and Pack
run: pwsh ./build.ps1 -Version ${{ steps.version.outputs.version }}
- name: NuGet login (OIDC → temp API key)
id: login
uses: NuGet/login@v1
with:
user: ${{ secrets.NUGET_USER }}
- name: Push to NuGet (Trusted Publishing)
run: |
for pkg in artifacts/*.nupkg; do
dotnet nuget push "$pkg" \
--source https://api.nuget.org/v3/index.json \
--api-key "${{ steps.login.outputs.NUGET_API_KEY }}" \
--skip-duplicate
done