Skip to content
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
31 changes: 25 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,34 @@ permissions:

jobs:
lint:
name: shellcheck + syntax
name: fmt + clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
# shellcheck is preinstalled on ubuntu-latest runners.
- name: rustfmt
run: cargo fmt --all -- --check
- name: clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: unit tests
run: cargo test --locked --all-features
- name: shellcheck
run: shellcheck -S warning zc tests/run.sh
run: shellcheck -S warning tests/run.sh
- name: bash syntax
run: |
bash -n zc
bash -n tests/run.sh
run: bash -n tests/run.sh

msrv:
name: MSRV build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install the declared MSRV toolchain
run: rustup toolchain install 1.82 --profile minimal --no-self-update
- name: check
run: cargo +1.82 check --locked --all-features --all-targets

test:
name: integration tests
Expand Down Expand Up @@ -55,5 +70,9 @@ jobs:
with:
baseline: ${{ steps.fixture.outputs.baseline }}
working-directory: action-fixture
- name: Build zc
run: cargo build --release --locked
- name: Run integration tests
env:
ZC: ${{ github.workspace }}/target/release/zc
run: tests/run.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
237 changes: 237 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "zc"
version = "0.3.0"
edition = "2021"
rust-version = "1.82"
description = "Detect public API and dependency changes across all workspace crates between two git refs."
license = "MIT OR Apache-2.0"
repository = "https://github.com/ZcashFoundation/zc"

[[bin]]
name = "zc"
path = "src/main.rs"

[dependencies]
hex = "0.4"
regex = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sha1 = "0.10"

[profile.release]
debug = false
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,18 @@ cargo install cargo-public-api --version 0.52.0 --locked
rustup toolchain install nightly-2026-07-18 --profile minimal
```

Then get `zc` itself — it's a single Bash script. Install it onto your `PATH`:
Then install `zc` itself, a single Rust binary:

```sh
curl -fsSL https://raw.githubusercontent.com/ZcashFoundation/zc/v0.3.0/zc -o ~/.local/bin/zc
chmod +x ~/.local/bin/zc
cargo install --git https://github.com/ZcashFoundation/zc --tag v0.3.0 --locked
```

…or run a one-off without installing:
…or from a checkout:

```sh
curl -fsSL https://raw.githubusercontent.com/ZcashFoundation/zc/v0.3.0/zc | bash -s -- main
cargo install --path . --locked
```

> When run via `curl … | bash`, `--help` shows only a short usage (the script
> can't re-read its own source from a pipe); install it to a file for the full
> reference.

## Usage

```sh
Expand Down Expand Up @@ -242,9 +237,7 @@ Then ask Claude to "produce the changelog for PR #N" (or invoke `/zc N`).

## Requirements

- Bash 4+ (associative arrays). On macOS, zc tries to re-exec with `bash` from PATH, `/opt/homebrew/bin/bash`, or `/usr/local/bin/bash` before failing. Install it with `brew install bash`.
- [`cargo-public-api`](https://github.com/cargo-public-api/cargo-public-api)
- `jq`
- a `nightly` toolchain for rustdoc JSON builds

## Exit codes
Expand Down
10 changes: 3 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@ inputs:
runs:
using: composite
steps:
- name: Check system dependencies
- name: Build zc
shell: bash
run: |
if ! command -v jq >/dev/null 2>&1; then
echo "::error title=Missing zc dependency::Install jq on the runner before using this action."
exit 64
fi
run: cargo install --path "$GITHUB_ACTION_PATH" --locked --root "$RUNNER_TEMP/zc-bin"

- name: Install the Rust nightly used by zc
shell: bash
Expand Down Expand Up @@ -90,4 +86,4 @@ runs:
arguments+=("$INPUT_HEAD")
fi

"$GITHUB_ACTION_PATH/zc" "${arguments[@]}"
"$RUNNER_TEMP/zc-bin/bin/zc" "${arguments[@]}"
2 changes: 1 addition & 1 deletion skills/zc/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: >-
Run `zc --changelog`, curate its draft into
[librustzcash](https://github.com/zcash/librustzcash)-style entries, and
**write them into the repo's `CHANGELOG.md` files**. Needs `zc` on `PATH` (plus
its prereqs: `cargo-public-api`, `jq`, a nightly toolchain).
its prereqs: `cargo-public-api`, a nightly toolchain).

## Quick start

Expand Down
Loading