Github release zip containing only partial code from repo

偶尔善良 提交于 2021-02-07 08:17:20

问题


while the Github provide a way to releasing software, I don't know if possible to specify just some files of the current master repository to be released and be downloaded as a zip file.

I want to offer users the possibility to download a certain folder/files from the whole repository, like say; I have 3 files in my repoo, file_1.js, file_2.js, file_3.js - I want to make file_3.js a downloadable release as a zip file my_app_v1.0.zip.

How is that possible?

Thanks for any ideas :)


回答1:


The release is a way to attached binaries to a tag in your Git repo (in addition of the archive of the source code itself).
You can attach as many binaries as you want, which means you can build and package as many releases as you need.
One of those binaries can include a partial set of your repo codebase, should you chose to package it that way.

But a release isn't dynamically packaged, and it doesn't necessarily include the repo sources. It generally include the result of a repo build. Or any other element that you want to be part of a release.




回答2:


while the Github provide a way to releasing software, I don't know if possible to specify just some files of the current master repository to be released and be downloaded as a zip file.

How is that possible?

Thanks for any ideas :)

When a new release is created, the github platform creates for us two downloadable zipped files: Source code (.zip) and Source code (.tar.gz) both containing the whole repository source code. The above created files can't be deleted by user using the online user interface (www.githuh.com). So let's go on.

When you create or edit a release, you can upload any kind of files from your hard drive (you can't link files from your github repo to the release, in other words, you have to download the files from repo to your hard drive!!). In other words, you can upload what files as you want. BUT, folders!!! ;-)

If you have already created the release, you can click "Edit release" to manage (add/remove) files attached to your release.

In summary, the idea is:

  1. creating, in your hard drive, a zip file containing what you want from your repository;
  2. upload the created zip file by click on create/edit release buttons.


来源:https://stackoverflow.com/questions/25822564/github-release-zip-containing-only-partial-code-from-repo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!