enhanced publish.sh