-
Notifications
You must be signed in to change notification settings - Fork 189
Multiple questions related to this action. #24
Comments
See #4.
See #7.
I believe that |
So it is the generated file itself and I assume relative to the build environment (Similar to how you often have to define the location of a build file in a CI to make it use that)? |
Yep. This action seems not to modify that path at all (it is not even checked that the file exists): https://github.com/actions/upload-release-asset/blob/master/src/upload-release-asset.js |
I now tried creating a zip using the
This is weird as the task I set clearly has jobs:
publish:
runs-on: ubuntu-latest
- name: Upload to release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.release.upload_url }}
asset_path: ./build/release-${{ github.event.release.tag_name }}.zip
asset_name: release-${{ github.event.release.tag_name }}.zip
asset_content_type: application/zip Or would I need to use the "assets_url" instead of the "upload_url"? |
Without further context, I'd say that |
I use this action in a release event with type published, so the release itself is clearly available, meaning the link shouldn't be null/empty. |
"Shouldn't" means that it can be null/empty. You should check it, just in case. If you are just pushing a tag, AFAIK that's not "creating a release". If the action has any other trigger condition (missing context above), maybe it is being handled as a different event. |
Like I mentioned does this action trigger on creating a release and only after it is of the type I'm now just unsure if I need the |
I found a link in the code of this action, which links me to the upload a release asset doc, where it tells me that I should use the Could it be, that I first have to parse the JSON in any way to access the URL? |
(Sorry for all those messages, but it is a bit important for me.) What could be the reason? Wouldn't it be (more or less) guaranteed to have the URL when it is published? Or do I have to indeed parse the JSON to retrieve the URL from it? |
Another update to this: But with that did a new error appear that frustrates me beyond anything I know.
Before saying anything: I also tried it with The zip-file is created successfully according to the previous job, which zips it:
|
Thanks for the response, but this doesn't help at all. If you read my last comment would you know that the URL now works, but I'm unable to locate the zip-file that should be uploaded (The actions returns an error with unknown file/directory as reason) I appreciate the help, but I don't like it when I get responses to questions I was able to answer myself (And that I mentioned where fixed) |
@Andre601 Your yaml sinppet has answered my question, thanks. Maybe I can be of some help to you.
It seems like the archive file that was created was be named release-5.0.5 without the .ZIP file extension. That would explain why the file was not found. Just a guess... |
I currently search for an action which would allow me to upload files to already created releases of my project so I found this one.
I now have multiple questions which I want to ask.
First question is, if this already supports multi-file upload and placeholder text.
My project generates multiple different files that while having the same extension, do have different file names. It is always in the style of
<name>-<version>[-extra].jar
where name is the same across all files, version is too but changes when I update the version. And extra is either not there or different for each file.So I hope this has some sort of placeholder to allow uploading specific files generated (like
<project>-*.jar
)Next question is, what asset type I would need to set.
As you can see in the above examples do I have jar files, but I'm not quite sure what asset/MIME type I have to set for the release.
I vaguely remember to know that GitHub may even not have a supported type for jar.
Final question: Is
asset_path
required?I'm not 100% sure what I would need to put in
asset_path
which is why I would like to avoid it when possible.If not, then I would appreciate an explanation as to what exactly I have to put there.
The text was updated successfully, but these errors were encountered: