Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github release a specific folder

I have a repository that has a bunch of folders, but I want to create releases for just one of those folders.

Simpler story, it's for a gaming server, and I just want to create releases for the client, as the way of offering downloads of the client to players.

like image 973
crosenblum Avatar asked Aug 27 '17 16:08

crosenblum


1 Answers

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

  1. Create a new branch with the contents of your current branch and check it out (e.g. git checkout -b rel)
  2. 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)
  3. Move release folder contents to the root folder and delete the empty folder
  4. Stage and commit all changes (e.g. git add . + git commit -a -m "v1 release"
  5. (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")
  6. Push this new branch (e.g. git push --set-upstream origin rel)

2. Add an executable/installer to the release

  1. Browse and log into your account and head to https://github.com/USER-NAME/PROJECT-NAME/releases
  2. Click the button for a new release and fill in the release details, choosing the branch you created above
  3. 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.

like image 110
CPHPython Avatar answered Oct 06 '22 00:10

CPHPython