Updated common build script to allow to build prerelease and final versions on the build server