build: use a common.sh file for common operations