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

refactor: unified release-please workflow for crates.io publishing #3406

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
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
6 changes: 3 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ keys/setup
!prover/
!yarn.lock
!package.json
!Cargo.lock
!Cargo.toml
!core/Cargo.lock
!core/Cargo.toml
!contracts/
!setup_2\^26.key
!setup_2\^24.key
Expand All @@ -46,4 +46,4 @@ contracts/.git
!etc/env/dev.toml
!etc/env/consensus_secrets.yaml
!etc/env/consensus_config.yaml
!rust-toolchain
!core/rust-toolchain
1 change: 1 addition & 0 deletions .github/workflows/cargo-license.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: EmbarkStudios/cargo-deny-action@8371184bd11e21dcf8ac82ebf8c9c9f74ebf7268 # v2.0.1
with:
manifest-path: "./core/Cargo.toml"
command: check
command-arguments: "--hide-inclusion-graph"
2 changes: 1 addition & 1 deletion .github/workflows/ci-core-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
ci_run zkstack dev test rust
# Benchmarks are not tested by `cargo nextest` unless specified explicitly, and even then `criterion` harness is incompatible
# with how `cargo nextest` runs tests. Thus, we run criterion-based benchmark tests manually.
ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch
ci_run cargo test --manifest-path ./core/Cargo.toml --release -p vm-benchmark --bench oneshot --bench batch

loadtest:
runs-on: [ matterlabs-ci-runner-high-performance ]
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ jobs:
- '.github/workflows/new-build-contract-verifier-template.yml'
- '.github/workflows/ci-core-reusable.yml'
- '.github/workflows/ci-core-lint-reusable.yml'
- 'Cargo.toml'
- 'Cargo.lock'
- 'zkstack_cli/**'
- '!**/*.md'
- '!**/*.MD'
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/protobuf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ jobs:
git checkout $(git merge-base $BASE $HEAD) --recurse-submodules
working-directory: ./before
- name: compile before
run: cargo check --all-targets
working-directory: ./before/
run: cargo check --manifest-path ./core/Cargo.toml --all-targets
working-directory: ./before
- name: build before.binpb
run: >
perl -ne 'print "$1\n" if /PROTOBUF_DESCRIPTOR="(.*)"/'
`find ./before/target/debug/build/*/output`
| xargs cat > ./before.binpb
`find ./before/core/target/debug/build/*/output`
| xargs cat > ./before/.binpb

# after
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
Expand All @@ -62,19 +62,21 @@ jobs:
path: after
submodules: recursive
- name: compile after
run: cargo check --all-targets
run: cargo check --manifest-path ./core/Cargo.toml --all-targets
working-directory: ./after
- name: build after.binpb
run: >
perl -ne 'print "$1\n" if /PROTOBUF_DESCRIPTOR="(.*)"/'
`find ./after/target/debug/build/*/output`
`find ./after/core/target/debug/build/*/output`
| xargs cat > ./after.binpb

# compare
- uses: bufbuild/buf-setup-action@54abbed4fe8d8d45173eca4798b0c39a53a7b658 # v1.39.0
with:
github_token: ${{ github.token }}
- name: buf breaking
run: >
buf breaking './after.binpb' --against './before.binpb' --exclude-path 'zksync/config/experimental.proto'
--config '{"version":"v1","breaking":{"use":["WIRE_JSON","WIRE"]}}' --error-format 'github-actions'
run: |
pwd
ls -la
buf breaking './after.binpb' --against './before.binpb' --exclude-path 'zksync/config/experimental.proto' \
--config '{"version":"v1","breaking":{"use":["WIRE_JSON","WIRE"]}}' --error-format 'github-actions'
55 changes: 0 additions & 55 deletions .github/workflows/release-please-cargo-lock.yml

This file was deleted.

35 changes: 14 additions & 21 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
name: Release

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write
pull-requests: write

name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Run release-please
id: release
uses: google-github-actions/release-please-action@e4dc86ba9405554aeba3c6bb2d169500e7d3b4ee # v4.1.1
with:
token: ${{ secrets.RELEASE_TOKEN }}
config-file: .github/release-please/config.json
manifest-file: .github/release-please/manifest.json

- name: Send Release Info
if: ${{ steps.release.outputs.releases_created == 'true' }}
uses: matter-labs/format-release-please-for-slack-action@69e6fe9e4ec531b7b5fb0d826f73c190db83cf42 # v2.1.0
with:
release-please-output: ${{ toJSON(steps.release.outputs) }}
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_RELEASES }}
release:
uses: matter-labs/zksync-ci-common/.github/workflows/release-please.yaml@aba-release-please-support
secrets:
gh_token: ${{ secrets.RELEASE_TOKEN }}
cargo_registry_token: ${{ secrets.CRATES_IO_TOKEN }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK_RELEASES }}
with:
manifest: '.github/release-please/manifest.json' # Specify the path to the manifest file
config: '.github/release-please/config.json' # Specify the path to the configuration file
update-cargo-lock: true # Update Cargo.lock file in release PR
publish-to-crates-io: true # Enable publishing to crates.io
upgrade-dependencies: true # Upgrade dependencies across all workspaces
10 changes: 5 additions & 5 deletions .github/workflows/vm-perf-comparison.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ jobs:
run: |
ci_run zkstackup -g --local
ci_run zkstack dev contracts --system-contracts
ci_run cargo bench --package vm-benchmark --bench instructions -- --verbose || echo "Instructions benchmark is missing"
ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes
ci_run cargo bench --manifest-path ./core/Cargo.toml --package vm-benchmark --bench instructions -- --verbose || echo "Instructions benchmark is missing"
ci_run cargo run --manifest-path ./core/Cargo.toml --package vm-benchmark --release --bin instruction_counts | tee base-opcodes

- name: checkout PR
run: |
Expand All @@ -66,17 +66,17 @@ jobs:
run: |
ci_run zkstackup -g --local
ci_run zkstack dev contracts --system-contracts
ci_run cargo bench --package vm-benchmark --bench instructions -- --verbose
ci_run cargo bench --manifest-path ./core/Cargo.toml --package vm-benchmark --bench instructions -- --verbose

ci_run cargo bench --package vm-benchmark --bench instructions -- --print > instructions.log 2>/dev/null
ci_run cargo bench --manifest-path ./core/Cargo.toml --package vm-benchmark --bench instructions -- --print > instructions.log 2>/dev/null
# Output all lines from the benchmark result starting from the "## ..." comparison header.
# Since the output spans multiple lines, we use a heredoc declaration.
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "speedup<<$EOF" >> $GITHUB_OUTPUT
sed -n '/^## /,$p' instructions.log >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT

ci_run cargo run --package vm-benchmark --release --bin instruction_counts -- --diff base-opcodes > opcodes.log
ci_run cargo run --manifest-path ./core/Cargo.toml --package vm-benchmark --release --bin instruction_counts -- --diff base-opcodes > opcodes.log
echo "opcodes<<$EOF" >> $GITHUB_OUTPUT
sed -n '/^## /,$p' opcodes.log >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ zksync_pk.key
dist
todo

Cargo.lock
!/Cargo.lock
core/Cargo.lock
!/core/Cargo.lock
!/infrastructure/zksync-crypto/Cargo.lock
!/prover/Cargo.lock
!/zkstack_cli/Cargo.lock
Expand Down
Loading
Loading