30.nuget-pack.sh 829 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. set -e
  2. # bash 30.nuget-pack.sh
  3. #---------------------------------------------------------------------
  4. # args
  5. args_="
  6. export basePath=/root/temp/svn
  7. export NUGET_PATH=$basePath/Publish/release/.nuget
  8. # "
  9. if [ ! $NUGET_PATH ]; then NUGET_PATH=$basePath/Publish/release/.nuget; fi
  10. #----------------------------------------------
  11. echo "30.nuget-pack.sh"
  12. docker run -i --rm \
  13. --env LANG=C.UTF-8 \
  14. -v $NUGET_PATH:/root/.nuget \
  15. -v $basePath:/root/code \
  16. serset/dotnet:sdk-6.0 \
  17. bash -c "
  18. publishPath=/root/code/Publish/release/release/nuget
  19. cd /root/code
  20. for file in \$(grep -a '<pack>nuget</pack>' . -rl --include *.csproj)
  21. do
  22. echo pack \$file
  23. mkdir -p \$publishPath
  24. cd /root/code
  25. cd \$(dirname \"\$file\")
  26. dotnet build --configuration Release
  27. dotnet pack --configuration Release --output \"\$publishPath\"
  28. done
  29. "