Github's "source code (zip)" is incomplete? (folder missing) - github

On Github repository I have one file ("changelog.txt") and one folder ("source") containing, as the name suggests, the source code of the zipped executable (the program). See Github Repository.
However, when I go to the release page - see Github Release - I can download the zipped executable, but when I try to download the source code - see Source Code (zip) - there is only "changelog.txt", and the entire "source" folder (containing the actual code) is missing.
I understand that Github's "Source Code (zip)" is auto-generated based on the content of the repository, so I deleted the old release, and created a new one + re-uploaded the zipped executable, but it doesn't seem to work and I still have only "changelog.txt" when I try to download the source.
It's not the end of the world since the source code is still accessible from the repository (see the first link), but such a problem could potentially annoy the people who would like to download the source from the release page.
Is there a solution ? Or did I do something the wrong way ?
Thanks for your answers, and sorry for my bad English (it is not my native tongue).

Related

How to add files for the Source code (.zip) dowload on GitHub

I wanted to share my program on GitHub.
I have a .exe file for the download and the source code for the source code (.zip)
But how can I add something to the Source code thing? I ended up with something like this.
(The source code files are the "Class" ones and the "main" one, and they are not in the Source code) When I dowload the Source Code there is only the redme.md file inside.
You would need to, through GitHub Action:
create a new artifact, for instance a zip file with your actual sources, using for example montudor/action-zip
create a release, and upload to said release your artifacts, including the new one created before. You can use softprops/action-gh-release
The idea remains: the "Source code" artifacts automatically created by GitHub are not (from what I can see) modificable.
But you can create your own release and upload/add your own artifacts, including one which would have your source code as you want.

Adding files to GitHub does not update the Releases Assets source code

Using GitHub via a browser, I am failing to create the Releases assets source code zip and tar.gz files that contain my src/filename.php files.
Syncing to Packagist appears to work OK, but Composer then not unexpectedly fails to load my source files into the usual vendor/packagename/src/ subdirectory.
I have tried loading the source files themselves into the main part of the repository into subdirectory /src using Add file. I have also added a zipped and a tarballed version into Releases file upload.
GitHub documentation is somewhat light on this, so could someone kindly explain exactly what I am doing wrong.
My finger trouble somewhere...
I was indeed incrementing the tag version, but it seems as if the php code additions I did to the main branch (with file upload) had for some unfathomable reason be made AFTER the new tag (release). Packagist then synched to the new tagged version but this was obviously missing the code additions.
My remedy was simply to methodically update the code again, check the json for tag version, and then finally release with an incremented tag.
Incidentally, there was no error message - just a total absence of php modules in my myvendor/mypackagename/src !

Github - Download Not Fully Included All Folders/Files

I am new to Github. I downloaded the PHPWord (link below) on Github, but some how the folders: samples, tests, docs are missing. It only has the folder "src/PhpWord".
https://github.com/PHPOffice/PHPWord
I also use composer require phpoffice/phpword and the result is the same (missing folders)
Am I doing something wrong or there is another way to download which will include the other folders: samples, tests, docs.
Thanks in advance,
The reason the other folders are missing may be due to you downloaded the Zip file and not a clone to your PC which downloads everything including the source code.
The Zip download only contains one file folder to the program. I suspect this is the finished product rather than the development product your seeing in the GitHub repository. Although, usually the author of the program includes this in the instructions which I didn't see when reading them.
You may also want to re-read the instructions on the REAME.md document in the repository. There are some requirements that need to be preformed before using composer to install the dependencies. It may account for the "missing folders" message

How do I download source code of all the versions of a repository on Github using some automated script?

I have details of few public repositories on GitHub. Is there a way to write a script which downloads the source code of all those repositories on to my local machine? While downloading the source code I want all the previous versions of project to be downloaded.
Ex: Project RxJava has about 124 releases as shown here. I want to know if there is a way to write a program which downloads source code of all these 124 releases on to my machine. I don't want to click on download source code button on each of these releases.
The easiest is to:
clone the repo (that will give you the sources matching each tags)
do a git tag and for each tag, curl the release.
Actually, since the release is the source code, you don't have to curl anything.
To access the source code of a "release", simply checkout the tag matching the release.
cd /path/to/cloned/repo
git checkout 1.0.8
This is how I figured the solution:
Using the Repository Search API get the details of required the projects.
This gives you a JSON object which has the below property
"releases_url": "https://api.github.com/repos/ReactiveX/RxJava/releases",
Use the above url to get a JSON object which describes release details of project
The JSON obtained in step 3 has a property as given below for each version of project
"zipball_url": "https://api.github.com/repos/ReactiveX/RxJava/zipball/v1.0.8",
Now copy the content from above URL in to an output stream to fetch the required source code.
Sample source code is available here
I know I am seven years late, yet I think this solution might help people with the same prolem:
I developed a simple bash script that you can find in this GitHub Gist that allows you to download all versions from every file currently in the repository. The output data is located in subfolders matching the name of the file, containing all its versions. The original directory tree of the repository is kept.
Hope anyone finds this useful!

Bitbucket: Bind a file from tip to be download-able

I am working inside a private repository, and collaborate with my friend, who are not very friendly with SCM and stuff. All he need is to monitor the latest release from my development, which is 1 single executable file.
I was wondering instead of cloning the whole repo each time he want to get the latest changes (sometimes my changeset can consists of several large binary files that only being used upon development, not testing). Can I bind the executable file into the Download section in BitBucket?. So that everytime I build my project, the executable file will appear in the Download section and he can download it right away.
For now all I can see from Bitbucket's download section is just the manual upload and Tag/Snapshot download, which I presume will pack a certain changesets into a compressed file. Is there any chance I can do this?.
Thanks.
If your executable file is checked into the repository, you can link to it at a specific revision:
https://staging.bitbucket.org/<username>/<repo>/raw/<revision>/file.exe
For example, this link will always give you the latest stable hg(1) man page from the Mercurial repository:
https://bitbucket.org/mirror/mercurial/raw/stable/doc/hg.1.txt
This would give you latest README on the default branch from the Django repository:
https://bitbucket.org/django/django/raw/default/README
If your executable isn't checked into the repository (some prefer not to check in build artifacts), you'll need to manually upload them in the downloads section of your repository. There isn't a REST API for creating project downloads at the moment.
Would giving your friend an archive of the tip work? Try this URL:
https://bitbucket.org/<username>/<project>/get/tip.tar.gz
#Idan's suggestion might already work for you, but if the archive is too big, you could set up an extra repository for binaries which automatically gets updated, committed and pushed by your build process. Then your fellow developer could download a comparatively small tip archive as suggested by Idan.
In addition to Idan's answer:
To fetch the latest version from the 'default' branch:
https://bitbucket.org/<username>/<project>/get/default.tar.gz
You can replace 'default' by any other branch name, tag name or changeset (if you know it).