After a action is finished I can download the produced artifacts from a popup menu in the upper right corner of the build log.
When it is a zip file it will show up as "a-file.zip" but after downloading it will show up as "a-file.zip.zip" on my disk and I need to unpack twice.
Can the download logic be changed so that zip files are not re-zipped?
Solved! Solved! Go to Solution.
Did you use the action actions/upload-artifact to upload artifacts in your workflow?
I tested and checked this with different OSs, all the downloaded artifacts were normal and shown as .zip, not .zip.zip .
If possible, can you share your repository with us, so that we can check your workflow configurations to analyze the root cause?
When using the action actions/upload-artifact to upload artifacts, the action will automatically package the files in the specific path (can be a directory path or a file path) as a ZIP and names the ZIP with the specific name (artifact name).
I checked your workflow configurations, and found:
- name: "publish action-artifact zip" uses: actions/upload-artifact@v1 with: name: DclareForMPS.zip path: build/artifacts/DclareForMPS/DclareForMPS.zip
There are 2 questions in your workflow about this:
1) You have set the artifact name as DclareForMPS.zip, so the artifact will be zipped as DclareForMPS.zip.zip.
2) Before upload the artifact, you have zipped the files as a ZIP in the specific path, that means the uploaded file itself is already a ZIP file. This is the root cause that you must unzip your artifact twice.
After executing the action actions/upload-artifact, the structure of your artifact will like below:
DclareForMPS.zip.zip ┕ DclareForMPS.zip
To avoid this misunderstanding, I recommend you take the following updates:
1) Set the artifact name as DclareForMPS, not DclareForMPS.zip.
2) Before upload the artifact, directly copy the folders or files you want to upload as artifact into the specific path (build/artifacts/DclareForMPS), instead of zipping them at first.
3) After above two updates, the step configuration should look like below:
- name: "publish action-artifact zip" uses: actions/upload-artifact@v1 with: name: DclareForMPS path: build/artifacts/DclareForMPS
That explains a lot! Thanks.
I think I was a bit misled by the term artifact which sounds more like a file then a dir to me, but that is bias ;-).
This gives me the workaround I needed.
I would still like to propose this as a feature request though:
- do not zip an already zipped file if it is the only artifact