build.sh: fix file selection logic for upload