taiki-e / upload-rust-binary-action

GitHub Action for building and uploading Rust binary to GitHub Releases.
Apache License 2.0
246 stars 22 forks source link

Script breaks when archiving is disabled #83

Open br0kenpixel opened 2 months ago

br0kenpixel commented 2 months ago

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
taiki-e commented 2 months ago

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.

br0kenpixel commented 2 months ago

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.