chore: release v0.2.2 #24
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: public-api | |
| # Tripwire for accidental public-API changes in the published library. The | |
| # committed baselines under public-api/*.txt are the source of truth; this job | |
| # regenerates each crate's surface and fails if it drifts. When a change is | |
| # intentional, regenerate the baseline in the same PR (command printed on failure) | |
| # — that makes every API change a conscious, reviewable edit. Complements | |
| # semver.yml: that job catches BREAKING changes against the published crate, this | |
| # one catches ANY change, additive included. | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| public-api: | |
| runs-on: ubuntu-latest | |
| env: | |
| # The committed baselines are only reproducible if BOTH inputs are pinned. | |
| # cargo-public-api renders from rustdoc JSON, so the nightly that produces | |
| # that JSON decides the output text just as much as the tool version does: | |
| # a floating nightly rewrote `std::io::error::Error` to `core::io::error::Error` | |
| # and reddened this gate on an API that had not changed at all. | |
| # Bumping NIGHTLY is therefore a deliberate act that regenerates the | |
| # baselines in the same commit -- never one without the other. | |
| CARGO_PUBLIC_API_VERSION: "0.52.0" | |
| NIGHTLY: "nightly-2026-05-12" | |
| OMIT: "blanket-impls,auto-trait-impls,auto-derived-impls" | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable | |
| - name: Install nightly (cargo-public-api needs rustdoc JSON) | |
| run: rustup toolchain install "$NIGHTLY" --profile minimal | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| - name: Install cargo-public-api | |
| run: cargo install cargo-public-api --locked --version "$CARGO_PUBLIC_API_VERSION" | |
| - name: Check public API against committed baselines | |
| run: | | |
| fail=0 | |
| for crate in blob-decoder; do | |
| echo "::group::$crate" | |
| cargo "+$NIGHTLY" public-api -p "$crate" --all-features --omit "$OMIT" > "/tmp/$crate.txt" | |
| if ! diff -u "public-api/$crate.txt" "/tmp/$crate.txt"; then | |
| echo "::error::Public API of $crate changed. If intentional, regenerate the baseline in this PR:" | |
| echo " cargo public-api -p $crate --all-features --omit $OMIT > public-api/$crate.txt" | |
| fail=1 | |
| fi | |
| echo "::endgroup::" | |
| done | |
| exit $fail |