How to add folders when publish a package?

Hi, everyone, I have a problem of adding folders when I try to publish a package. It seems like if I manually put a folder under the root directory, then the package will automatically extract files in that folder and put all files under the extra folder. I do see lots of packages have subfolders under the extra files, can you guys tell me how to do it?