30.nuget-pack.sh 871 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. mkdir -p $basePath/Publish/release/release
  11. #----------------------------------------------
  12. echo "30.nuget-pack.sh"
  13. docker run -i --rm \
  14. --env LANG=C.UTF-8 \
  15. -v $NUGET_PATH:/root/.nuget \
  16. -v $basePath:/root/code \
  17. serset/dotnet:sdk-8.0 \
  18. bash -c "
  19. publishPath=/root/code/Publish/release/release/nuget
  20. cd /root/code
  21. for file in \$(grep -a '<pack>nuget</pack>' . -rl --include *.csproj)
  22. do
  23. echo pack \$file
  24. mkdir -p \$publishPath
  25. cd /root/code
  26. cd \$(dirname \"\$file\")
  27. dotnet build --configuration Release
  28. dotnet pack --configuration Release --output \"\$publishPath\"
  29. done
  30. "