How to know which editor published a post programmatically?

As far as I know, WordPress only stores original authors of the posts. If you want to also save the publisher’s ID, you need to do a bit of custom coding, or use some 3rd party plugin.

Essentially what you need to do is to store the user ID whenever the post status is being changed to publish. For that you can use the publish_{your_post_type} action (replace {your_post_type} with your custom post type slug). If your CPT slug is project for example, your action should look like this:

function save_project_publisher_meta( $post_id, $post  ) {

    // Set current user ID as a post meta
    update_post_meta( $post_id, 'publisher_id', get_current_user_id() );
}
add_action( 'publish_project', 'save_project_publisher_meta', 10, 3 );

Now the publisher ID should be stored as a post meta for each post, and you can access the user data whenever you need by retrieving the publisher ID using get_post_meta:

// Get WP_User object from ID
$publisher_id = get_post_meta( $post_id, 'publisher_id' );
$publisher = get_user_by( 'id', $publisher_id );

// Get whatever user data you need
$publisher_email = $publisher->user_email;

Note this will only affect newly published posts. Posts that were published in the past won’t have publisher IDs stored, until you re-publish them.