Move artifact upload code into the shell script