action-gh-release icon indicating copy to clipboard operation
action-gh-release copied to clipboard

File not found after upload

Open XanatosX opened this issue 3 years ago • 2 comments

If I upload some files with the action the files are only downloadable while the release is a draft, after that I will get a file not found just like #86 mentioned. I do use the following configuration for the upload

       - name: Get release name
         id: getReleaseName
         run: echo ::set-output name=RELEASE_NAME::${GITHUB_REF/refs\/tags\//}
       - name: Create last unstable Release
         uses: softprops/action-gh-release@v1
         with:
           name: Latest unstable
           body: This is the latest unstable build version, feel free to test it out. Most of the time only the windows build got tested!
           tag_name: ${{ steps.getReleaseName.outputs.RELEASE_NAME }}-${{ GITHUB.RUN_NUMBER }}
           draft: false
           prerelease: true
           files: releases/**.zip
         env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  

I do try to upload a build like that but I do get the same error as the inital creator. Now my problem this pipeline runs as soon as as someting is getting pushed to the develop branch.

This should provide some "latest builds" so the tag will be /refs/tags/develop-{Runner number}. But this leads to the 404 error if the build is not in draft :( Is there something wrong with my usage of the script?

Link does look like this https://github.com/D-Generation-S/Tank/releases/download/refs%2Fheads%2Fbug%2F51_artifacts-cannot-be-downloaded-42/Latest_MacOsGameArtifact.zip If I create a release by hand it looks like this https://github.com/D-Generation-S/Tank/releases/download/refs%2Fheads%2Fbug%2Frefs%2Fheads%2Fbug%2F51_artifacts-cannot-be-downloaded-testing/Latest_WindowsGameArtifact.zip and does not work as well.

So this seems to be a problem with GitHub itself?

XanatosX avatar Jan 05 '22 18:01 XanatosX

Created a ticket withing the github community https://github.community/t/release-artifacts-not-downloadable-not-found/221418 since this seems to be a problem with the tag created not the action.

XanatosX avatar Jan 05 '22 19:01 XanatosX

I did test around and the following solution did work

       - name: Replace part of tag
         run: echo "custom_tag=latest-unstable" >> $GITHUB_ENV
       - name: Create last unstable Release
         uses: softprops/action-gh-release@v1
         with:
           name: Latest unstable
           body: This is the latest unstable build version, feel free to test it out. Most of the time only the windows build got tested!
           tag_name: ${{ env.custom_tag }}-${{ GITHUB.RUN_NUMBER }}
           draft: false
           prerelease: true
           files: releases/**.zip
         env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  

I do create a unique tag with the runner number and a fixed string. This seem to resolve the issue

XanatosX avatar Jan 05 '22 20:01 XanatosX