The "if" is significant. If you work on weapons that turn out to be used to stop legitimately bad actors with minimal collateral damage, then your hands are as clean as anyone's can be in war.
I don't generally believe in black and white, so I'm making no claims that anything is 100% ethical, 100% unethical, 100% blood on your hands, etc. I think it's possible for good people to work on weapons and still sleep soundly at night. I also think it's possible for good people to work on weapons and end up regretting the consequences of that choice.
If you're working on weapon systems that will be used to attack, say, Nazi Germany, and you know or expect that they will also kill innocent civilians, then you are de-facto endorsing that murdering[0] innocent civilians is worth it to stop Nazi Germany, which is a resonable, if debatable, position.
If you're working on weapon systems that (you know or expect) will be just be directly used for murdering[1] innocent civilians, then you're endorsing murdering innocent civilians.
If you don't know where on that scale things are, then you're reasoning under uncertainty, and your ethics are going to have to deal with that.
0: technically most of those would actually be manslaughter, going by the usual definitions, but a: not all, b: that's not a verb.
I don’t think both of those can be true simultaneously, unless you somehow consider “having blood on your hands” to be ethical.