The documentation of PDE has a chapter for this topic. Basically it’s simply. Copy the template scripts what you want from templates/headless-build folder under org.eclipse.pde.build plug-in to your build configuration directory that is the folder has build.properties file.
However I found the variables listed in template ‘customAssembly.xml’ can’t be used in the runtime. I filed bug 346370 against it.