title: Can I get bazel to trigger extra actions after a target is built?
body: <p>I have a bazel rule that produces an artifact. How should I do to add a post-processing step with the artifact produced as a dependency?</p>
  
  <p>We have a big build system where our macros are used in several BUILD files. So now I need to add another step that would use the artifacts produced by a specific macro to create another artifact, and hopefully without having to update all BUILD files.</p>
  
  <p>In a non-bazel context I would probably use something that triggers the extra step, but in the bazel context, the best thing I have come up with have been to add a new macro, that uses the rule created by the other macro as a dependency.</p>
  
  <p>It is something like this today:<br/>
  Macro M1 generate rule R1 - which produce artifact A.<br/>
  Buildfile B use macro M1 and when that target is built artifact A is produced.</p>
  
  <p>So I can now add a macro M2 that generate rule R2, which produce artifact B.<br/>Artifact A is a dependency to this rule.<br/>The users will use macro M2 instead.</p>
  
  <p>But can I do this in some other way? </p>
  
  <p>Example of a use case could be that I have a macro that produces a binary, and I now want to add e.g. signing. "The users" will still want to build that binary, and the signed artifact is created as a bi-product of little interest for the users.</p>