-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support manifest path override #32
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Could you update the inputs options table in readme?
main.sh
Outdated
manifest_path="${INPUT_MANIFEST_PATH:-}" | ||
if [[ -n "${manifest_path}" ]]; then | ||
build_options+=("--manifest-path" "${manifest_path}") | ||
build_options+=("--target-dir" "${RUNNER_TEMP}/target") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is probably preferable to use cargo metadata
to get the default target directory, rather than setting our own target directory.
Something like the following:
if [[ -n "${manifest_path}" ]]; then
build_options+=("--manifest-path" "${manifest_path}")
target_dir=$(cargo metadata --format-version=1 --no-deps --manifest-path "${manifest_path}" | jq -r '."target_directory"')
else
target_dir=$(cargo metadata --format-version=1 --no-deps | jq -r '."target_directory"')
fi
if [[ -n "${INPUT_TARGET:-}" ]]; then
build_options+=("--target" "${target}")
target_dir="${target_dir}/${target}/release"
else
target_dir="${target_dir}/release"
fi
Sorry for the delay! I made the changes you asked for but have not tested it out yet. I can drop a comment here once I've tried a release. |
I tested this out and it's working nicely. Thanks for the review & the cargo metadata help! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Published in 1.10.0. |
This adds support for building crates that aren't in the repository's root directory.
Closes #31