cmsBuild: fix building and uploading in a single job

After building a package, register its hash and full version in the global tags_cache object.
In this way, the "upload" action will pick the same tag for the package, instead of trying to assign it a new one.