Hi Nolan,
I work a lot with Jenkins, but I never used it for a Particle project so far.
However, I can tell you what I would do.
1- a Jenkins Agent (linux based) with Particle CLI installed would build, test and then flash my devices
2- I think this resource and this other resource can help.
From one of those:
you can use the command line parameter -D with gcc to #define a value at compile time.
$ gcc file.c -o file -D"THE_VERSION_STRING=${THE_VERSION_STRING}"
aw crap, I see now that I do not know how to use any -D using the Particle CLI, so what I mentioned above may not help much.
Perhaps someone with better knowledge of the build like @m_m would know?
Hope I was able to get you closer, but I’m not sure.
Gustavo.