What do you mean by automate?  More like `sed` or `.. include:: VERSION`?