Check out the "repomanage" utility from the yum-utils RPM. It does exactly what you're looking for.
[root ~]# repomanage --help
repomanage: manage a directory of rpm packages. returns lists of newest
or oldest packages in a directory for easy piping to xargs
or similar programs.
repomanage [--old] [--new] path.
-h, --help show this help message and exit
-o, --old print the older packages
-n, --new print the newest packages
-s, --space space separated output, not newline
-k KEEP, --keep=KEEP newest N packages to keep - defaults to 1
-c, --nocheck do not check package payload signatures/digests
If the uploads happen everyday, why not consider deleting the old files which are older beyond say certain number of days(in terms of their access/modification times)? Find and just delete them. If you could have your developers upload builds such that they put the name of the current month into the filename when uploading, it would make sense from the filename directly that the file was uploaded in so called month'year and it makes sense to delete just by the basis of looking at the filename. It would make easy for your script automation to just consider removing those files or just keep those files which match previous month and current month. Just a thought.