upload-artifact icon indicating copy to clipboard operation
upload-artifact copied to clipboard

upload-artifact zips .tar.gz archive

Open n0toose opened this issue 5 years ago • 7 comments

Describe the bug Uploading a .tar.gz artifact results in the archive being .zipped. Many (if not probably most) projects on GitHub tend to prefer the .tar.gz extension, rather than .zip, so it most likely isn't a good idea to archive them again under a different format and/or forcing maintainers to use a specific version.

Version

  • [ ] V1
  • [x] V2

Environment

  • [ ] self-hosted
  • [x] Linux
  • [ ] Windows
  • [ ] Mac

Screenshots

image

Run/Repo Url As I may take down or otherwise modify my tree at any given moment, here's the pull request in question.

How to reproduce

  • Step 1: Create .tar.gz archive in a workflow.
  • Step 2: Upload it.
  • Step 3: 🎊

Additional context Also see: #39

n0toose avatar Aug 05 '20 17:08 n0toose

If you currently upload an any archive file (.zip, .zipx, 7z, .tar, .tar.xz etc), and then attempt to download it from the UI, the current behavior is that you'll get a zip of whatever you uploaded.

This is a limitation of our APIs and our UI, some of my earlier comments go into more details https://github.com/actions/upload-artifact/issues/39#issuecomment-598825674 and https://github.com/actions/upload-artifact/issues/39#issuecomment-612869499

If you also look at our public api to download an artifact, you'll notice that we currently require a zip :archive_format: https://developer.github.com/v3/actions/artifacts/#download-an-artifact and that is what effectively is being used when you click to download an artifact. Ideally we should have options that let get the raw contents of whatever was uploaded without any archiving format, but we currently don't have any solutions 😞

konradpabjan avatar Aug 11 '20 10:08 konradpabjan

@konradpabjan is this behavior going to change at some point or we are stuck with it for life? It's unclear from your comments.

(I get that it's not a limitation of this action, but this is where users are affected, so I think it would make sense to post some updates here or envolve someone who works on the API.)

sagikazarmark avatar Sep 24 '20 09:09 sagikazarmark

@sagikazarmark

We absolutely have plans to address this, it's on our backlog but there are other priorities that are currently preventing us from picking up the work. Our public roadmap has some high level priorities for Actions for those curious: https://github.com/github/roadmap/projects/1

The experience right now leaves a lot to be desired and an overhaul for the Artifacts UI + better API support has come up in internal discussions multiple times. We're definitely planning on addressing this.

konradpabjan avatar Sep 25 '20 16:09 konradpabjan

+1 on this, I compress all my artifacts to .tar.xz but I have no choice but to download them as .zip files that I have to unzip to recover the already-compressed .tar.xz artifact. Is this going to be fixed anytime soon? It's a pain

awakecoding avatar Sep 01 '21 17:09 awakecoding

This is basically a duplicate of:

  • https://github.com/actions/upload-artifact/issues/39

The solution for both would be to avoid zipping "compressed archives"

fregante avatar Oct 27 '21 11:10 fregante

https://github.com/actions/upload-artifact/issues/109#issuecomment-699030493 says:

Our public roadmap has some high level priorities for Actions for those curious: https://github.com/github/roadmap/projects/1

Currently that link still works but gives a warning that classic Projects will be sunset on August 23, 2024. For anyone reading this after August 23, 2024, the address for GitHub's public roadmap is now https://github.com/orgs/github/projects/4247/views/1.

rmunn avatar Jun 21 '24 05:06 rmunn

any news about this? always upload as zip...

johnnynunez avatar Jan 31 '25 15:01 johnnynunez

This is especially infuriating because uploading a tgz created from npm pack then yields the contents as a zip file on retrieval, meaning that a simple workflow like this:

(simplified)

      - name: Package
        run: dnpm pack
      - name: Archive generated npm package
        uses: actions/upload-artifact@v4
        with:
          name: npm-package
          path: my-0.0.0.tgz
          if-no-files-found: error
      - name: Download generated npm package
        uses: actions/download-artifact@v4
        with:
          name: npm-package
          path: my-0.0.0.tgz
      - name: Publish to npm
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
        run: npm publish my-0.0.0.tgz

does not work at all anymore.

joscha avatar Apr 03 '25 13:04 joscha