Skip to content

Commit a0d5a50

Browse files
committed
fix(scripts): enhance NuGet push handling for Linux environments
Update build-dist.sh to improve NuGet package publishing on Linux by introducing a check for the dotnet CLI, which avoids SSL issues with nuget.exe. Adjust documentation to clarify the use of dotnet for pushing packages and the limitations of nuget.exe on Linux.
1 parent a8cc2dc commit a0d5a50

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

scripts/build-dist.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,18 @@ push_nuget() {
245245
echo "Defina NUGET_API_KEY en $ENV_FILE o en el entorno." >&2
246246
return 1
247247
}
248-
command -v nuget >/dev/null || { echo "nuget no encontrado." >&2; return 1; }
248+
249249
echo "==> Publicando en nuget.org"
250+
# dotnet CLI usa OpenSSL del sistema; nuget.exe (Mono) falla con CERTIFICATE_VERIFY_FAILED en Linux.
251+
if command -v dotnet >/dev/null 2>&1; then
252+
dotnet nuget push "$nupkg" \
253+
--source https://api.nuget.org/v3/index.json \
254+
--api-key "$NUGET_API_KEY" \
255+
--skip-duplicate
256+
return $?
257+
fi
258+
259+
command -v nuget >/dev/null || { echo "Se requiere dotnet CLI o nuget.exe." >&2; return 1; }
250260
nuget push "$nupkg" -Source https://api.nuget.org/v3/index.json \
251261
-ApiKey "$NUGET_API_KEY" -SkipDuplicate
252262
}
@@ -373,7 +383,7 @@ Repo GitHub: $GITHUB_REPO
373383
374384
Notas
375385
- Compilación: msbuild (preferido) o xbuild. En Ubuntu instale mono-complete del repo oficial Mono.
376-
- En Linux no use 'nuget restore' (SSL Mono + MSBUILD0004); use restore-packages.sh.
386+
- En Linux: nuget pack/push con nuget.exe (Mono) falla SSL; pack usa rutas del nuspec, push usa dotnet nuget push.
377387
- nuget sign (Author Signing) requiere Windows; aquí se publica unsigned (Repository Signing).
378388
- Si empuja el tag, CI puede duplicar NuGet/GitHub Release — use una vía u otra.
379389

0 commit comments

Comments
 (0)