download-artifact
download-artifact copied to clipboard
[feat req] document downloading from another workflow
What would you like to be added?
information pertaining to how to download from another workflow
Why is this needed?
because why would I want to download artifacts from the same workflow
I have basically the same needs, and what I ended up doing was making the first workflow into a reusable workflow and then calling that from the second. The first uploads it's artifacts as part of the second workflow in that case, and then the second one can later download them.
Here's one of the "source" workflows, this one compiles an application: https://github.com/MiyooCFW/miyooctl/blob/b688c4758615f443f4395a5adab87c3a16bebfd6/.github/workflows/build.yml
And, this is where the second "mega build" workflow calls the "source" one, running it on the submodule in the "mega build" repo: https://github.com/TriForceX/MiyooCFW/blob/c3b3901aee3c9d6675358c29e25e9587bca7768c/.github/workflows/build.yml#L92-L95 ...and a later job that uses the artifacts from the first one to build a sdcard image that includes the application from the source: https://github.com/TriForceX/MiyooCFW/blob/c3b3901aee3c9d6675358c29e25e9587bca7768c/.github/workflows/build.yml#L114-L167
One gotcha is that I couldn't figure out how to run the version of the workflow from the submodule, so it instead runs master. That hasn't caused trouble yet, since they're usually the same. But it could cause an issue in theory.
For workflows that take longer, I also added caching. Here's an example of that: https://github.com/MiyooCFW/kernel/blob/9d69b562d8dc252a93af80e399069312e89e2184/.github/workflows/build.yml - with caching, most "mega builds" complete in a couple of minutes, even though that particular job takes 5-8 minutes when uncached, and there's another one that takes 20-30 minutes.
Any official word on this? Reusable workflows speed things up but I can't use them if I can't download the build workflow artifacts to use them in the testing workflow.
This exists https://github.com/dawidd6/action-download-artifact and the guy seems trustable (nokia employee and maintainer of Homebrew) but I would rather use something official.
Is there any news for this? I have a similar scenario as for the above comments, to be able to download an artifact from a re-usable workflow. Would PR's to add this functionality be approved?