Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Artifact doesn't exist when it does? #29

Open
jwvanderbeck opened this issue Jun 6, 2021 · 5 comments
Open

Artifact doesn't exist when it does? #29

jwvanderbeck opened this issue Jun 6, 2021 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@jwvanderbeck
Copy link

I've been beating my head against the wall on this all day today and I don't know what I am doing wrong.

I build the project, copy some files, and zip them up in steps before this one. Then I call this one with the path to the ZIP file that should be added to the release.

Yet it always tells me the artifact doesn't exist, despite it clearly being there. I even used ls to output the files after zipping them to verify, yes, the zip file is there as expected.

I'm wondering if there is some cross docker barrier or something I am running into? I don't know anything about docker :(

You can see a run here: https://github.com/KSP-RO/RSSTimeFormatter/runs/2755047394?check_suite_focus=true

Here is one of the failures with the relevant (I think) bits highlighted
opera_D9vnaU3uEh_LI

@skx
Copy link
Owner

skx commented Jun 6, 2021

I've not had this issue myself, but it does make me wonder if the different steps are running in new containers without shared state.

I've certainly seen people report that, and resort to temporary uploads/downloads for example:

I guess the simplest way to test would be to add a step between your zip and upload actions. Something like:

      - name: Assemble release
        id: assemble-release
        run: |
          RELEASE_DIR="${RUNNER_TEMP}/release"
          echo "Release dir: ${RELEASE_DIR}"
          echo "Release zip: ${RELEASE_DIR}/RSSDateTime-${{ github.event.release.tag_name }}.zip"
          mkdir -v "${RELEASE_DIR}"
          echo "::set-output name=release-dir::${RELEASE_DIR}"
          cp -v -R "${GITHUB_WORKSPACE}/GameData" "${RELEASE_DIR}"
          zip ${RELEASE_DIR}/RSSDateTime-${{ github.event.release.tag_name }}.zip ${RUNNER_TEMP}/release/GameData ${RUNNER_TEMP}/release/GameData/RSSDateTime/* ${RUNNER_TEMP}/release/GameData/RSSDateTime/Plugins/RSSTimeFormatter.dll
          ls -lrt -d -1 "${RELEASE_DIR}"/{*,.*}

      - name: sanity-check
        id: assemble-release-check
        run: |
          echo "Release:"
          ls -R /home/runner/work/_temp/release
          echo "Workspace"
          ls -R /home/runner/work/
          echo "Runner"
          ls -R /home/runner/

      - name: release
        uses: skx/github-action-publish-binaries@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          args: ${{ steps.assemble-release.outputs.release-dir }}/RSSDateTime-${{ github.event.release.tag_name }}.zip        

(The way I do things is to add a ".github/build" script to do the build, then just run the two actions after each other. e.g:

on: release
name: Handle Release
jobs:
  upload:
    name: Upload
    runs-on: ubuntu-latest
    steps:
    - name: Checkout the repository
      uses: actions/checkout@master
    - name: Generate the artifacts
      uses: skx/github-action-build@master
    - name: Upload the artifacts
      uses: skx/github-action-publish-binaries@master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        args: rss2email-*

That always seems to work, with the second step running ".githhub/build" and the third step uploading the result. Sample https://github.com/skx/rss2email/tree/master/.github

@skx skx self-assigned this Jun 6, 2021
@skx skx added the question Further information is requested label Jun 6, 2021
@skx
Copy link
Owner

skx commented Jun 6, 2021

https://medium.com/@fonseka.live/sharing-data-in-github-actions-a9841a9a6f42 implies /github is shared. Which actually kinda works for me - since I always end up writing to /github/workspace, rather than /home/runner.

You could try updating the ls to look at that, and copy the zip-file there too as another suggestion.

@jwvanderbeck
Copy link
Author

I did manage to get this working last night with the exact same flow, except swapping out your action with actions/upload-release-asset@v1 : https://github.com/KSP-RO/RSSTimeFormatter/blob/3b9974e6c0be9cb3ce06dac91654ed3634ac5202/.github/workflows/release-created.yml

I think you're right about the data but I think it is something specific to the fact that your action runs in a Docker container whereas the others, including that one there, do not. Maybe as you say only the /github/workspace is shared with Docker?

I have it working now so I need to finish up there, but once done I will try to loop back to test this more at least so we known.

@skx
Copy link
Owner

skx commented Jun 7, 2021

Yes I wonder if docker is to blame - you can certainly see the shared volumes being documented in the command-lines which are echo'd as the various stages run.

I wonder if I should depreciate this action now, if there's an "official" one beneath the /actions namespace. I'll have to find some time this/next week myself to test things out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants