Upload-artifact: Download artifacts of latest build

Created on 5 Oct 2019  路  6Comments  路  Source: actions/upload-artifact

I'm working with two workflows in different platforms (A and B) and the workflow B needs an artifact of the workflow A. Also, I'm trying to avoid external services as S3 in order to make it simple.

Is there a way to get a link to the artifacts generated in the last build (latestbuild) or in the last passed build (lastsuccessfulbuild)?

Maybe something like this: https://github.com/{account}/{repo}/workflows/{workflowName}/builds/latest/artifacts/file.zip

Most helpful comment

This is more of an issue on the download-artifact side. See: https://github.com/actions/download-artifact/issues/3

No rough ETA but this is something that we really really want to do since it will help enable more complete CI/CD experiences.

All 6 comments

I would like to know how to get link url too. ref https://github.com/actions/upload-artifact/issues/2#issuecomment-536166961

This is more of an issue on the download-artifact side. See: https://github.com/actions/download-artifact/issues/3

No rough ETA but this is something that we really really want to do since it will help enable more complete CI/CD experiences.

Also see related discussions like #27 and #50.

We would like a direct URL for our nightly builds (like the format proposed in the issue description).
We don't want to trash our repositories GitHub Releases for nightly binaries / many tagged releases - we are also fine with short retention for nightly builds.

We had previously used Travis CI and AppVeyor CI, where none of this was any issue. With GitHub Actions it's a massive headache / various issues.

I had made a quick and dirty tool to redirect users to the latest artifact URL using the new API.
This tool is at https://github.com/JayFoxRox/GitHub-artifact-URL/

However, now the actions API and artifact URLs only work for authenticated users: https://github.com/JayFoxRox/GitHub-artifact-URL/issues/4 so the tool doesn't even work for our use-case anymore (which is frustrating, as we waited for a solution for weeks, and had manually updated the download URL on our website for now).
I think a simple script like mine would still work for other use-cases in this issue, though.

I have created #51 for the permission issue.

@JayFoxRox, you might find eine/tip useful or, at least, inspiring. As a matter of fact, I wrote that action in JavaScript several months ago. Artifacts were not supported, so my strategy was to use a single pre-release and update it. It didn't work as expected, because recreating the release would spam all watchers.

Then, I rewrote it as a Docker Action in Python. The pre-release is kept, but assets are updated/overwritten, hence notifications are not triggered. The usage of tip is similar to this action. Precisely, I accumulate all the artifacts with upload-artifact and I use an additional job to update the "nightly" release:

  nightly:
    needs: [ lin, win ]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/download-artifact@v2
      with:
        path: ./
    - uses: eine/tip@master
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        tag: 'nightly'
        files: |
          ./artifact/*

tip also force-pushes the tag, for it to point to the commit that corresponds to the updated artifacts/assets.

The advantage compared to using GitHub-artifact-URL, is that the pre-relase provides a nice and consistent URL for users to download assets, and no authentication is required: https://github.com/user/repo/releases/download/nightly/artifact_name.ext.

Also see related discussions like #27 and #50.

We would like a direct URL for our nightly builds (like the format proposed in the issue description).
We don't want to trash our repositories GitHub Releases for nightly binaries / many tagged releases - we are also fine with short retention for nightly builds.

We had previously used Travis CI and AppVeyor CI, where none of this was any issue. With GitHub Actions it's a massive headache / various issues.

I had made a quick and dirty tool to redirect users to the latest artifact URL using the new API.
This tool is at https://github.com/JayFoxRox/GitHub-artifact-URL/

However, now the actions API and artifact URLs only work for authenticated users: JayFoxRox/GitHub-artifact-URL#4 so the tool doesn't even work for our use-case anymore (which is frustrating, as we waited for a solution for weeks, and had manually updated the download URL on our website for now).
I think a simple script like mine would still work for other use-cases in this issue, though.

I have created #51 for the permission issue.

Thank you so much!

Was this page helpful?
0 / 5 - 0 ratings