From f4e436a1e948eb53c943de1b0b50ea2fe1b83cae Mon Sep 17 00:00:00 2001 From: Anton Baliasnikov Date: Tue, 21 Jan 2025 12:19:44 +0000 Subject: [PATCH] test --- .github/actions/publish-crates/action.yaml | 2 +- .github/workflows/release-please.yaml | 25 ++++++++-------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/actions/publish-crates/action.yaml b/.github/actions/publish-crates/action.yaml index b2eaf22..bc5c366 100644 --- a/.github/actions/publish-crates/action.yaml +++ b/.github/actions/publish-crates/action.yaml @@ -50,7 +50,7 @@ runs: - name: Install Rust toolchain uses: moonrepo/setup-rust@v1 with: - bins: 'cargo-workspaces,cargo-get' + bins: 'cargo-workspaces' - name: Build the workspace before release shell: 'bash -ex {0}' diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index 3c7f76d..4aec30c 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -163,7 +163,7 @@ jobs: - name: Install Rust toolchain uses: moonrepo/setup-rust@v1 with: - bins: 'cargo-workspaces,cargo-get' + bins: 'cargo-workspaces' - name: Update Cargo.lock shell: 'bash -ex {0}' @@ -174,28 +174,22 @@ jobs: if [[ ${BRANCH} == *components* ]]; then COMPONENT="${BRANCH##*--}" COMPONENT_PATH=$(jq -r --arg component ${COMPONENT} '.packages | to_entries[] | select(.value.component == $component) | .key' ${{ inputs.config }}) + COMPONENT_VERSION=$(jq -r ".${COMPONENT_PATH}" ${{ inputs.manifest }}) ( cd "${COMPONENT_PATH}" - if [[ ${{ inputs.version-suffix }} != '' ]]; then - WORKSPACE_VERSION=$(cargo get workspace.package.version) - cargo workspaces version custom ${WORKSPACE_VERSION}-${{ inputs.version-suffix }} \ + if [[ '${{ inputs.version-suffix }}' != '' ]]; then + cargo workspaces version custom ${COMPONENT_VERSION}-${{ inputs.version-suffix }} \ --all --no-git-commit --force "*" --yes fi cargo update --workspace ) - else if [[ '${{ inputs.workspace-dirs }}' != '' ]]; then + 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. + echo 123 for WORKSPACE in ${{ inputs.workspace-dirs }} ; do - ( - 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 - ) + ( cd "${WORKSPACE}" && cargo update --workspace ) done fi # Commit changes to Cargo.lock if any @@ -231,7 +225,7 @@ jobs: max-parallel: 1 # Publish workspaces one by one to prevent possible rate limiting issues steps: - name: Publish crates - uses: matter-labs/zksync-ci-common/.github/actions/publish-crates@aba-custom-crates-suffix + uses: matter-labs/zksync-ci-common/.github/actions/publish-crates@v1 with: workspace_path: ${{ matrix.path }} org_owner: ${{ inputs.org-owner }} @@ -240,7 +234,6 @@ jobs: slack_webhook: ${{ secrets.slack_webhook }} run_build: ${{ inputs.run_build }} run_tests: ${{ inputs.run_tests }} - version-suffix: ${{ inputs.version-suffix }} # This job upgrades the workspace dependencies across different workspaces of one repository.