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