pipeline { agent any stages { stage('nuget'){ steps{ dotnetPack(outputDirectory: "./", project: "nugettest/") sh """ filename=\$(ls ./*.nupkg | head -1) fullfilename=\$(basename -- \$filename) noext=\${fullfilename%.*} mv fullfilename \$noext-\$BUILD_NUMBER.nupkg files=null fullfilename=null noext=null """ dotnetNuGetPush(root: "./*.nupkg") } } } }