If you dig deeper in addArtifactArg
you will find:
const bin_file = artifact.getEmittedBin();
bin_file.addStepDependencies(&run.step);
Yes, it is not easy. And it takes some time to get used with the build system.
Looking in Build System Tricks is a nice way to start with your build.zig
.