I created a publish permission, and I want to this permission can only execute the publish action in my tweet contract. How to link the permission to the action?
I think, you have an incorrect idea regarding permissions in eos. A permission in itself does not have any authority to do anything, but an account with a certain permission can be used to authorise actions.
Now, if that is clear, what you may do for your problem is, in your action (member function's definition), you can check that only accounts with the "publish" permissions are allowed to execute this action.
This may be done by using the following eoslib function for an account