This might be helpful for some people.
I used circleci to do this. Here are my commands
nvm install 7
nvm alias default 7
npm install -g exp
npm install
npm test
exp login -u $EXP_USERNAME -p $EXP_PASSWORD
exp publish --non-interactive
Although sometimes build fail while running exp publish --non-interactive
show error socket hang up