Rpm packaging and repository

Hello!

How to build rpm from C/C++ sources in Gitlab on version tag(i.e. 0.1.0) pushed?

Thanks.