move testing/publishing code into src/publish