Dynamicly fill the metainfo.xml file on build


We are looking for a way to generalize the metainfo.xml file and fill the release/date info as part of the build process, and not have them hard coded in the file.

Is this recommended, and if so, what is the recommended way to achieve this?

this should be part of the dist process, ie the one that generate the tarballs for the release.

So each time we tag and create a release, we should generate the file?
What can we do about the master branch which is not tagged?

flathub is not for nightly builds. So there is that.