When a release is published, the automatically generated Source Code .zip and .tar.gz files include all files in the branch you choose here:
![Selecting git branch for release]()
Therefore, I answered the OP's question this way:
1. Use a branch containing only the release contents
- Create a new branch with the contents of your current branch and check it out (e.g.
git checkout -b rel)
- Delete all non-release files and folders (don't worry, you're only deleting them from the new branch, confirm you are on the right one using
git branch)
- Move release folder contents to the root folder and delete the empty folder
- Stage and commit all changes (e.g.
git add . + git commit -a -m "v1 release"
- (optional: do not do this if you prefer using the Github interface for writing the release details) Create a release version tag (e.g. `git tag v1.0.0 -m "initial release")
- Push this new branch (e.g.
git push --set-upstream origin rel)
2. Add an executable/installer to the release
- Browse and log into your account and head to https://github.com/USER-NAME/PROJECT-NAME/releases
- Click the button for a new release and fill in the release details, choosing the branch you created above
- Since GitHub limits uploads of files larger than 50MB (unless you use Git LFS), your runnables (e.g. .exe or .apk) can be added and uploaded into the release itself before publishing it via drag-and-drop:
![Dragging files to release]()
The release will be automatically saved as draft and, only upon publishing, the Source Code archive files will be generated (without the runnables you added above).
P.S.: Images and steps for creating and editing a release available on Managing Releases Gihub Docs page.