dotnet publish 命令,bash脚本如下(Windows安装git即可建议sh关联)
publish.sh
#!/usr/bin/env bash # one line command: # array=( win-x64 linux-x64 osx-x64 ); for i in "${array[@]}"; do printf " >>> building $i ... "; dotnet publish -r $i -c Release -p:PublishSingleFile=true; done set +x +e # runtime array: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog array=( win-x64 linux-x64 osx-x64 ) config='Release' # publish args: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish args='' declare -i count=${#array[*]} declare -i num=1 printf '>>> 33[1;36mClean bin folder ... 33[0m ' find . -type d ( -iname 'bin' -o -iname 'obj' ) | xargs rm -rf printf '