diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index 5102736..df03ab6 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -79,6 +79,11 @@ on: description: 'Commit message for Cargo.lock update.' required: false default: 'chore: update Cargo.lock' + version-suffix: + type: string + description: 'Suffix to add to the version of the crates.' + required: false + default: '' outputs: releases_created: description: "Whether release-please created a new GitHub releases." @@ -157,6 +162,8 @@ jobs: # and take care of the proper caching to speed up CI. - name: Install Rust toolchain uses: moonrepo/setup-rust@v1 + with: + bins: 'cargo-workspaces' - name: Update Cargo.lock shell: 'bash -ex {0}' @@ -167,8 +174,17 @@ jobs: if [[ ${BRANCH} == *components* ]]; then COMPONENT="${BRANCH##*--}" COMPONENT_PATH=$(jq -r --arg component ${COMPONENT} '.packages | to_entries[] | select(.value.component == $component) | .key' ${{ inputs.config }}) - ( cd "${COMPONENT_PATH}" && cargo update --workspace ) - else + COMPONENT_VERSION=$(jq -r ".${COMPONENT_PATH}" ${{ inputs.manifest }}) + ( + cd "${COMPONENT_PATH}" + if [[ '${{ inputs.version-suffix }}' != '' ]]; then + cargo workspaces version custom ${COMPONENT_VERSION}-${{ inputs.version-suffix }} \ + --all --no-git-commit --force "*" --yes + fi + cargo update --workspace + ) + fi + if [[ '${{ inputs.workspace-dirs }}' != '' ]]; then # In case of a one PR for multiple components # update Cargo.lock for all components using the workspace-dirs input. for WORKSPACE in ${{ inputs.workspace-dirs }} ; do