edrdos icon indicating copy to clipboard operation
edrdos copied to clipboard

How to download actions artefacts to server using wget?

Open ecm-pushbx opened this issue 1 year ago • 10 comments

More of a github use question. I cannot seem to download artefacts from the github actions using wget. If I long tap on a download link for "EDR-DOS 1.44M image (KERNEL.SYS flavor)" in eg the action at https://github.com/SvarDOS/edrdos/actions/runs/10457933833 in Firefox mobile and select "Copy link" it gives eg https://github.com/SvarDOS/edrdos/actions/runs/10457933833/artifacts/1828656622 but then wget returns a 404 for this address.

If I do open the link in Firefox using a short tap it does offer me a download, but this would save the file onto my mobile, not the server that I want to load it onto. Example in a screenshot:

Screenshot_20240821-120313

ecm-pushbx avatar Aug 21 '24 10:08 ecm-pushbx

Are you logged in to Github, as I think you have to be to download artefacts?

andrewbird avatar Aug 21 '24 10:08 andrewbird

It's wget, so ECM is not logged indeed. Apparently this kind of things requires to use an "API token".

Maybe there is a way to make these artifacts truly public, but I do not see any such option at hand.

mateuszviste avatar Aug 21 '24 10:08 mateuszviste

Are you logged in to Github, as I think you have to be to download artefacts?

Yes, I suspected that may be related. I don't know how to "log in" to github from the server's command line to use wget. I just checked, if I do try the link in a browser as pasted here while not logged in I also get a 404 page.

ecm-pushbx avatar Aug 21 '24 10:08 ecm-pushbx

fwiw there's a firefox plugin called cliget that hooks into the download dialog and shows a curl command line that includes the precise headers that would be sent from the browser, including cookies.

rofl0r avatar Aug 21 '24 10:08 rofl0r

I had a similar problem to overcome for 'publishing' the latest comcom32 binary. I added this to the build workflow https://github.com/dosemu2/comcom64/commit/536acae87d94323c900d2889bc2030262e566860 which abuses the unused github pages facility for this project. The zipfile can then be accessed by https://dosemu2.github.io/comcom64/. Obviously it's not ideal, you have to ensure that part of the action is only run on the project's main branch, and I do worry about how much space is being used at Github to store each new version. Thankfully in my case there's not much commit traffic on that repository, but it may be an issue if yours is under active development.

andrewbird avatar Aug 21 '24 10:08 andrewbird

fwiw there's a firefox plugin called cliget that hooks into the download dialog and shows a curl command line that includes the precise headers that would be sent from the browser, including cookies.

https://addons.mozilla.org/de/firefox/addon/cliget/ Apparently it's this, but it seems to be incompatible with mobile Firefox.

ecm-pushbx avatar Aug 21 '24 10:08 ecm-pushbx

I did not notice that the artifacts are only downloadable if logged in, so it is good that this issue was created! Seems that it is possible to create "releases" from the Github actions. Looks like the Open Watcom V2 project does this: https://github.com/open-watcom/open-watcom-v2/releases. I will test how we can implement this, and if these releases are accessible without logging in.

boeckmann avatar Aug 21 '24 13:08 boeckmann

The current release at https://github.com/open-watcom/open-watcom-v2/releases/tag/Current-build does have the direct file link https://github.com/open-watcom/open-watcom-v2/releases/download/Current-build/open-watcom-2_0-c-dos.exe which works even when not logged in.

ecm-pushbx avatar Aug 21 '24 13:08 ecm-pushbx

I do not think that I am able to do this in five minutes. This whole CI stuff is reasonably complex. As an interim solution, I uploaded a snapshot release manually, so that people can at least get a reasonably working kernel without having to login.

boeckmann avatar Aug 21 '24 15:08 boeckmann

I downloaded it from the snapshot, thanks. I wanted to see whether copying uncapitalised filenames onto the image using mcopy would create LFN entries. It does not! Instead, mcopy sets the MSWindows NT compatible bits in the dePlusSize byte to indicate the file basename and extension should be uncapitalised.

ecm-pushbx avatar Aug 21 '24 15:08 ecm-pushbx