Skip to content
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

feat: add custom crates version suffix support #14

Merged
merged 3 commits into from
Jan 21, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
test
antonbaliasnikov committed Jan 21, 2025
commit ab5ab4585f53a687586389a0b3ecee9df72b7b4b
2 changes: 1 addition & 1 deletion .github/actions/publish-crates/action.yaml
Original file line number Diff line number Diff line change
@@ -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}'
24 changes: 8 additions & 16 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
@@ -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,21 @@ 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.
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 +224,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 +233,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.