This script creates a clean GitHub release archive using Automator to exclude .git files and folders. To use this:
1. Create a new application in Automator
2. Add a Run AppleScript action to the workflow
3. Paste in the following code:
on run {input}
set projectpath to POSIX path of (input as string)
set projectparent to POSIX path of ((do shell script "dirname " & quoted form of projectpath) as string)
set excludedfiles to "*.git* *.DS_Store*"
-- Return the last path component (to get the project folder name)
if projectpath is "/" then return "/"
if item -1 of projectpath is "/" then set projectpath to text 1 thru -2 of projectpath
set text item delimiters to "/"
set projectname to text item -1 of projectpath
-- Change working directory to project parent and create archive
do shell script "cd \"" & projectparent & "\"; zip -r " & projectname & ".zip \"" & projectname & "\" -x " & excludedfiles
return input
end run
4. Save as an application
All you have to do now is drag and drop the project folder onto the application.
Tested in OS X 10.11 beta 6