upload-rust-binary-action icon indicating copy to clipboard operation
upload-rust-binary-action copied to clipboard

Script breaks when archiving is disabled

Open br0kenpixel opened this issue 1 year ago • 2 comments

I noticed that if I turn off archiving, the script crashes after compilation. I'd like to be able to upload the binaries directly, without them being archived.

- uses: taiki-e/upload-rust-binary-action@v1
  with:
    bin: ...
    target: ${{ matrix.target }}
    tar: none
    zip: none
    token: ${{ secrets.GITHUB_TOKEN }}

The workflow fails with the following error:

/Users/runner/work/_actions/taiki-e/upload-rust-binary-action/v1/main.sh: line 484: assets[@]: unbound variable

br0kenpixel avatar Sep 03 '24 07:09 br0kenpixel

tar: none + zip: none doesn't mean upload binary as-is. It means that don't upload anything unless asset option is used (it's not a documented behavior though...).

Support for the builtin feature to upload binaries without archiving is being tracked in #6, and suggestions for APIs and implementations are welcome.

Workaround is using the asset option as described here.

Aside from that, the error message here is not nice and it needs to be fixed separately.

taiki-e avatar Sep 03 '24 07:09 taiki-e

Thanks!

I'm guessing there's no way to rename the asset, right? Your suggestion worked, but it would be nice to be able to add the target triple to the binary name. Also, there could be a way to remove the exe extension when building for a non-Windows target.

br0kenpixel avatar Sep 03 '24 07:09 br0kenpixel