Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test
Browse files Browse the repository at this point in the history
antonbaliasnikov committed Jan 21, 2025
1 parent bad23cb commit 9234788
Showing 2 changed files with 20 additions and 16 deletions.
14 changes: 0 additions & 14 deletions .github/actions/publish-crates/action.yaml
Original file line number Diff line number Diff line change
@@ -35,11 +35,6 @@ inputs:
type: string
description: 'Slack webhook to use for notifications.'
required: true
version-suffix:
type: string
description: 'Suffix to add to the version of the crates.'
required: false
default: ''


runs:
@@ -74,15 +69,6 @@ runs:
working-directory: ${{ inputs.workspace_path }}
run: cargo login ${{ inputs.cargo_registry_token }}

- name: Add custom version suffix
if: ${{ inputs.version_suffix != '' }}
shell: 'bash -ex {0}'
working-directory: ${{ inputs.workspace_path }}
run: |
WORKSPACE_VERSION=$(cargo get workspace.package.version)
cargo workspaces version custom ${WORKSPACE_VERSION}-${{ inputs.version_suffix }} \
--all --no-git-commit --force "*" --yes
- name: Release packages to crates.io
shell: 'bash -ex {0}'
working-directory: ${{ inputs.workspace_path }}
22 changes: 20 additions & 2 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
@@ -162,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,cargo-get'

- name: Update Cargo.lock
shell: 'bash -ex {0}'
@@ -172,12 +174,28 @@ 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 )
(
cd "${COMPONENT_PATH}"
if [[ ${{ inputs.version-suffix }} != '' ]]; then
WORKSPACE_VERSION=$(cargo get workspace.package.version)
cargo workspaces version custom ${WORKSPACE_VERSION}-${{ inputs.version-suffix }} \
--all --no-git-commit --force "*" --yes
fi
cargo update --workspace
)
else 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
( cd "${WORKSPACE}" && cargo update --workspace )
(
cd "${WORKSPACE}"
if [[ ${{ inputs.version-suffix }} != '' ]]; then
WORKSPACE_VERSION=$(cargo get workspace.package.version)
cargo workspaces version custom ${WORKSPACE_VERSION}-${{ inputs.version-suffix }} \
--all --no-git-commit --force "*" --yes
fi
cargo update --workspace
)
done
fi
# Commit changes to Cargo.lock if any

0 comments on commit 9234788

Please sign in to comment.