Michiel's answer was almost what I was looking for until I found out that the archive does not include parent folder which is highly necessary for WordPress plugin developers once you are trying to archive a plugin.
If WordPress plugin does not include the container folder, then WordPress is unable to install a plugin.
So I spent quite a bit of time trying to learn Shell commands and testing until I came up with a working solution that would include the container folder inside the newly created archive.
And this is the script you can copy and reuse:
name=("$@")
cd "$name"
cd ..
zipFileName=`basename "$name"`
zip "${zipFileName}.zip" -r "$zipFileName" -x "*.git*" -x "*.svn*" -x "*/.DS_Store" -x "*/__MACOSX"
Created an in-depth article about this topic on my blog with additional images and notes here.