public class GStatsPublisher extends Recorder
{
  @Override
  public boolean perform(final AbstractBuild<?, ?> build,
                         final Launcher launcher,
                         final BuildListener listener)
  {
    // do the stuff 

    build.getActions().add(new GStatsBuildAction(build, results));

    listener.getLogger().out.println("... OK");
  } 

  public Action getProjectAction(final AbstractProject<?, ?> project)
  {
    return new GStatsProjectAction(project);
  }

  @Extension
  public static final GStatsPublisherDescriptor DESCRIPTOR = 
      new GStatsPublisherDescriptor();
} 
    
Note the extension annotation isn't on the class, but on this descriptor. A descriptor is a bit like a class on steroids. It knows how to configure and create a new action.