build: extract common parts from addon .buildstamp
This commit extracts common parts from the targets test/addons/.buildstamp, and test/addons-napi/.buildstamp to reduce some duplication.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines