You must declare your action in your layer.xml file. Like this:

<folder name="Toolbars">
   <folder name="Build">
         <file name="org-mymodule-MyAction.instance"/>
   </folder>
</folder>

Source: NetBeans FAQ