I’ve been using StableBuild for this sort of thing. It’s not exactly what you’re describing, but might be relevant.
You basically point your builds at it instead of the upstream repos. Once you’ve pulled something, it keeps that version around, even if it gets deleted or changed upstream.
Not sure if that covers what you need, but it’s worked well for me.