The private sector seems to be able to do this without undue difficulty.
Senior people leave all the time for better pay. The companies have to either promote a junior person to take on the project or hire someone.
Government jobs attract lifers; people who want the security, stability and retirement benefits of a government job.
The government does not need bonuses to keep its people.
Many actually are hired into ongoing multi-year developmental projects.
You should check on how Department of Defense works sometime. They have an awful lot of systems analysts, computer systems designers, logistics personnel, etc. AS WELL AS war planners, spending their careers "doing stuff" (much of it too secret for you to hear about).
Frankly the government should relocate to the suburbs and abandon the downtowns to the federal courts.