It is surprising that this repo (the scripts and documentation in this project) is licensed under MIT, since there is little to no relevant content to be licensed. However, I'm concerned about this from a practical point of view. I believe that most of the currently open issues (specially #3) could be fixed by the community, should we have any code to look at. It'd be really useful if the glue logic that gathers the artifacts and names them was open sourced, along with some minimal docs about the backend API that this action is using.
~I guess it's here: https://github.com/skx/github-action-publish-binaries~
False alert :|
I also came looking for the source to see if upload-artifact supports me passing a command that returns a file path for the path input (e.g., yarn cache dir).
Update: It does not.
We are working towards this, our goal is for the community to be able to contribute fixes.
@tedmiston You can use Action Outputs to do that, something like:
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/upload-artifact@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
Though for that specific case, you probably want to use actions/cache instead
Sharing an update regarding open-sourcing this action
Sometime around mid-January mid-February we're planning on releasing a v2-beta version of this action. It will be fully open-sourced and written with Node + TypeScript (similar to our other actions such as actions/cache).
Currently this action is a plugin on the runner where it has some extra permissions to do certain things. The majority of the work being done for open-sourcing this involves creating new APIs that will be able to interact with artifacts without being tightly-coupled with the runner. A new open-sourced NPM package will be created that will consume/interact with these APIs (similar to what we have for @actions/core or @actions/io). Both upload-artifact and download-artifact will use this new package.
A lot of the top-requested issues/requests will be addressed such as #11 and #3.
More information and specifics will be shared right around the launch of the v2-beta version. Thank you everyone for your patience ❤
Our runner was recently open-sourced. You can find all of the current code for v1 that is specific to upload-artifact and download-artifact here: https://github.com/actions/runner/tree/master/src/Runner.Plugins/Artifact
Note: All the artifact code in the runner will eventually be removed once v2 is released and v1 becomes deprecated. The code is all currently tied to the runner because there are some env variables that are only available to the runner (you cannot access these from an action). These env variables are used to make the necessary API calls.
All the artifact code in the runner will eventually be removed once
v2is released andv1becomes deprecated.
Will that code be moved to this repo when it is removed from there?
Will that code be moved to this repo when it is removed from there?
The code will be split between this repo and a new one we are creating for the upcoming npm package. This action (along with download-artifact) will use the new package to make all of the necessary API calls. The new repo for the npm package will be open-sourced from the very beginning so most of the code will go there, anything else will end up here.
Hope #14 will be also addressed in upcoming release as we forced to upload HTML pages to external host and there is no smart way to reference this data in embedded github checks - means need to looks throught stdout of step to find out a link.
The v2-preview is ready to go. We would love to get feedback!
The core functionality to interact with artifacts can be found in the @actions/artifact package (this was setup so that it is easier for action builders to interact with artifacts)
https://www.npmjs.com/package/@actions/artifact
https://github.com/actions/toolkit/tree/master/packages/artifact
This action now also uses @actions/glob for things like wildcards and search:
https://www.npmjs.com/package/@actions/glob
https://github.com/actions/toolkit/tree/master/packages/glob
Everything else is in this repo 😀 Moving forward it will be much easier to accept contributions and feedback once the preview is over.
v2 upload artifact has been released! https://github.blog/changelog/2020-04-28-github-actions-v2-artifact-actions/
You can now use it by using actions/upload-artifact@v2 and all the source code is in the master branch.
You can find all the core upload logic here or in the @actions/artifact npm package. https://github.com/actions/toolkit/tree/master/packages/artifact
Artifact upload is now like a traditional typescript action and is no longer coupled to the runner. Moving forward it should be much easier to accept contributions and to add new features.
Most helpful comment
Sharing an update regarding open-sourcing this action
Sometime around
mid-Januarymid-February we're planning on releasing av2-betaversion of this action. It will be fully open-sourced and written with Node + TypeScript (similar to our other actions such asactions/cache).Currently this action is a plugin on the runner where it has some extra permissions to do certain things. The majority of the work being done for open-sourcing this involves creating new APIs that will be able to interact with artifacts without being tightly-coupled with the runner. A new open-sourced NPM package will be created that will consume/interact with these APIs (similar to what we have for
@actions/coreor@actions/io). Bothupload-artifactanddownload-artifactwill use this new package.A lot of the top-requested issues/requests will be addressed such as #11 and #3.
More information and specifics will be shared right around the launch of the
v2-betaversion. Thank you everyone for your patience ❤