Updated nightly test and publish script to fix bug in cross-compiles