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

ci: unified crates.io release workflow using release-plz #78

Merged
merged 4 commits into from
Dec 6, 2024
Merged
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
12 changes: 0 additions & 12 deletions .github/release-please/config.json

This file was deleted.

3 changes: 0 additions & 3 deletions .github/release-please/manifest.json

This file was deleted.

4 changes: 0 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: "Rust CI"
on:
pull_request:
paths:
- "crates/**"
- "Cargo.toml"
- ".github/workflows/ci.yaml"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
70 changes: 0 additions & 70 deletions .github/workflows/release-please-prepare-branch.yml

This file was deleted.

90 changes: 0 additions & 90 deletions .github/workflows/release-please.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on:
push:
branches:
- main

jobs:

rust-toolchain:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.rust-toolchain.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Extract rust toolchain version
id: rust-toolchain
run: echo "version=$(cat rust-toolchain)" >> "${GITHUB_OUTPUT}"

release:
needs: rust-toolchain
uses: matter-labs/zksync-ci-common/.github/workflows/release-plz.yaml@v1
secrets:
gh_token: ${{ secrets.RELEASE_TOKEN }}
cargo_registry_token: ${{ secrets.CRATES_IO_TOKEN }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK_RELEASES }}
with:
rust-toolchain: ${{ needs.rust-toolchain.outputs.version }}
7 changes: 2 additions & 5 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

## Automatic releases

We use [release-please](https://github.com/googleapis/release-please) to manage releases, as well
as a custom automation to publish releases on [crates.io](https://crates.io/).
We use [release-plz](https://release-plz.dev/) to manage and publish releases to [crates.io](https://crates.io/).

Any pull request name must follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
specification, and then, based on the PR titles, a release pull request will be created, which
Expand All @@ -22,7 +21,7 @@ sure that the change will trigger a release PR, mark the PR as `fix` or `feat`.
By default, a patch version will be bumped. If you want to bump a minor version, mark the PR as breaking with
an exclamation point, e.g. `feat!` or `fix!`.

It is recommended that each PR has a component mentioned, e.g. `feat(component): Change added`.
It is recommended that each PR has a component mentioned, e.g. `feat(component): change added`.

Once release PR is merged, it will be published to `crates.io`, and a notification will be sent to Slack.

Expand All @@ -31,8 +30,6 @@ Once release PR is merged, it will be published to `crates.io`, and a notificati
> [!WARNING]
> Manual releases are discouraged, and should only be used as a last resort measure.
> Discuss the manual release with the team beforehand and prepare a plan.
> It is very likely that manual release will interfere with `release-please` configuration,
> which will have to be fixed manually as well.
>
> Additionally, if the release was created, but wasn't published, you will only need a subset
> of the actions listed below (e.g. if the it failed due to a transient error, you just need to
Expand Down
24 changes: 24 additions & 0 deletions release-plz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[workspace]
dependencies_update = true # Wether to run `cargo update` in the release PR
pr_name = "chore(main): release {{version}}" # template for the PR name
pr_labels = ["release", "crates.io"] # Set PR labels
changelog_path = "./CHANGELOG.md" # Set common changelog path for all crates
changelog_update = false # Disable individual changelog updates for all packages.
git_tag_enable = false # Disable individual tags for all packages.
git_release_enable = false # Disable individual releases for all packages.
semver_check = false # Disable API breaking changes checks with cargo-semver-checks.
publish_timeout = "10m" # Set a timeout for `cargo publish`.

# Use one package to combine changelog updates and tags for all workspace
[[package]]
name = "circuit_definitions"
git_release_enable = true # Enable GitHub releases
git_tag_enable = true # Enable one common tag for all crates
git_tag_name = "v{{version}}" # Common tag name for the workspace
git_release_name = "v{{version}}" # Common GitHub release name
changelog_update = true # Enable changelog updates combining all crates
changelog_include = [
"circuit_encodings", "circuit_sequencer_api", "zksync_kzg",
"zkevm-assembly", "zk_evm", "zk_evm_abstractions",
"zkevm_circuits", "zkevm_opcode_defs", "zkevm_test_harness"
]
Loading