taiki-e / upload-rust-binary-action

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

Support working-directory #75

Open renatoathaydes opened 3 months ago

renatoathaydes commented 3 months ago

GitHub Actions like runs support changing the working-directory.

This is important as many repositories contain more than one project.

I may be missing something, but I can't seem to make the working-dir declared in defaults to work with this action.

Maybe that's not possible, but it would be nice if at least this action took an optional working-directory as input so that if I have a crate under ./my-crate/ instead of at the root, I won't get this error:

error: could not find `Cargo.toml` in `/home/runner/work/my-repo/my-repo` or any parent directory
taiki-e commented 3 months ago

error: could not find Cargo.toml in /home/runner/work/my-repo/my-repo or any parent directory

I believe you have to use manifest-path input option. (If you use this action outside of the cargo workspace, there is no way for the action side to automatically search for workspace based on the current directory.)

renatoathaydes commented 3 months ago

Thanks @taiki-e , I did end up using that and it worked. Still, could be a nice feature to allow using the fairly common input working-directory (which just means you change the working-directory before running anything else)? Anyway, feel free to close this ticket if you're not interested in adding that.

taiki-e commented 3 months ago

I thought working-directory: could be used together with uses:, is that not so?

renatoathaydes commented 3 months ago

My understanding is that it will only work if you make that part of your action's input.

taiki-e commented 3 months ago

Ok, if the native working-directory option cannot be used, I would accept a PR to add a working-directory input option.