How to share solutions in a way they won't get uploaded
I don't have real answers, and I suspect there are none.  I also reuse prompts, if only because good ones are almost absurdly hard to come up with, write-ups and supporting code take time, etc, etc, etc.
I've taken a series of steps to mitigate the cheating.  Some of these are peculiar to my own situation, and may not translate directly to another context, but they also illustrate the type of thinking I use when I consider this particular (and particularly intractable) problem.
The first is to not weigh labs heavily in the grading.  This sucks, because they are a huge portion of both the work and the learning in the class, but they are not trustworthy as high-stakes assessments if you do your assessment at the end by looking at the final result. (There is genuinely no getting around this fact.)
I explain this to my students, and encourage them, then, to use the labs as learning opportunities. The brunt of their grade comes from tests and quizzes. The labs help them to prepare.
Next I talk about plagiarism.  I require them to keep in comments links to stackoverflow, indications of where friends have helped them, and any other sources they used.  I point out that even very veteran software developers use stack overflow regularly, and I assure them that this sort of help is not cheating as long as it is cited.
Next, I make sure that my lab write-ups are extremely clear.  Cheating typically centers around nervousness more than laziness. When students feel like they are not quite sure how to be successful, but nevertheless fear the consequences of failure, cheating is a natural outcome.
Then I have in-class working sessions where I go around and observe how the students are doing, and help them get un-stuck.  This allows me to see regular progress, and helps the students to learn from the labs.
Finally, I grade some of the labs as code-review interviews, and award a harsh, current grade, and a second, more generous grade for once the required refactoring is complete.
I don't believe myself in thinking that this entirely nips the problem in the bud, but I have reason to believe that the outright copying is minimal in this setup.