From 36aad796f309f2ec51083c0077f7301e2e3433d1 Mon Sep 17 00:00:00 2001 From: cct0831 Date: Sat, 28 Mar 2026 20:05:20 +0800 Subject: [PATCH] fix(ci): use absolute path in NuGet smoke test to fix package resolution The --source parameter in `dotnet add package` was passed the source name "local-nupkgs" which NuGet resolves as a relative path from the current working directory (smoke/). After `cd smoke`, this becomes smoke/local-nupkgs which doesn't exist. Fix: use $NUPKG_DIR (absolute path via env var) for --source on all three `dotnet add package` calls. Also moves github.workspace into an env var per GitHub Actions security best practices. Fixes #731 Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/publish-nuget.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index b6fa2210f..50a318214 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -69,14 +69,15 @@ jobs: - name: Smoke test package install env: PKG_VERSION: ${{ steps.version.outputs.version }} + NUPKG_DIR: ${{ github.workspace }}/nupkgs run: | set -euo pipefail mkdir smoke && cd smoke dotnet new console --framework net10.0 - dotnet nuget add source "${{ github.workspace }}/nupkgs" --name local-nupkgs - dotnet add package WalkingTec.Mvvm.Core --version "$PKG_VERSION" --source local-nupkgs - dotnet add package WalkingTec.Mvvm.Mvc --version "$PKG_VERSION" --source local-nupkgs - dotnet add package WalkingTec.Mvvm.TagHelpers.LayUI --version "$PKG_VERSION" --source local-nupkgs + dotnet nuget add source "$NUPKG_DIR" --name local-nupkgs + dotnet add package WalkingTec.Mvvm.Core --version "$PKG_VERSION" --source "$NUPKG_DIR" + dotnet add package WalkingTec.Mvvm.Mvc --version "$PKG_VERSION" --source "$NUPKG_DIR" + dotnet add package WalkingTec.Mvvm.TagHelpers.LayUI --version "$PKG_VERSION" --source "$NUPKG_DIR" dotnet restore dotnet build -c Release --no-restore