Skip to content

Add --package support #103

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

Merged
merged 3 commits into from
Jun 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Currently, this action is basically intended to be used in combination with an a
| archive | | Archive name (non-extension portion of filename) to be uploaded | String | `$bin-$target` |
| target | \[2] | Target triple, default is host triple | String | (host triple) |
| features | | Comma-separated list of cargo build features to enable | String | |
| package | | Package name to build | String | |
| no-default-features | | Whether to disable cargo build default features | Boolean | `false` |
| locked | | Whether to build with `--locked` flag | Boolean | `false` |
| tar | | On which platform to distribute the `.tar.gz` file (all, unix, windows, or none) | String | `unix` |
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ inputs:
features:
description: Comma-separated list of cargo build features to enable
required: false
package:
description: Package name to build
required: false
locked:
description: Whether to build with `--locked` flag
required: false
Expand Down Expand Up @@ -165,6 +168,7 @@ runs:
INPUT_ARCHIVE: ${{ inputs.archive }}
INPUT_TARGET: ${{ inputs.target }}
INPUT_FEATURES: ${{ inputs.features }}
INPUT_PACKAGE: ${{ inputs.package }}
INPUT_LOCKED: ${{ inputs.locked }}
INPUT_NO_DEFAULT_FEATURES: ${{ inputs.no-default-features || inputs.no_default_features }}
INPUT_MANIFEST_PATH: ${{ inputs.manifest-path || inputs.manifest_path }}
Expand Down
5 changes: 5 additions & 0 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ case "${build_locked}" in
*) bail "'locked' input option must be 'true' or 'false': '${build_locked}'" ;;
esac

build_package="${INPUT_PACKAGE:-}"

bin_name="${INPUT_BIN:?}"
bin_names=()
if [[ -n "${bin_name}" ]]; then
Expand Down Expand Up @@ -292,6 +294,9 @@ fi
if [[ -n "${build_locked}" ]]; then
build_options+=(--locked)
fi
if [[ -n "${build_package}" ]]; then
build_options+=(--package "${build_package}")
fi
metadata_options=(--format-version=1 --no-deps)
manifest_path="${INPUT_MANIFEST_PATH:-}"
if [[ -n "${manifest_path}" ]]; then
Expand Down
Loading