From bb0a79885f65f698ad2e3734280c5cd05ced5dd9 Mon Sep 17 00:00:00 2001 From: Aron Date: Sat, 7 Nov 2026 23:33:01 +0800 Subject: [PATCH] CI(Release): Count the Rust crates as release paths and check every pushed commit The release paths were derived from the public packages only, so a fix in `crates/**` (compiled into the binding packages) or in the bundled private `internal` and `engine-js` workspaces had to use a non-release type and never released. List them in aronrepo.config.js together with the Cargo and tsdown build configuration, and regenerate the AGENTS.md block. A direct push skips the PR title check and can skip the commit hook (--no-verify, rebuilt or web-edited commits). commit-check.yml runs `aronrepo check` over every pushed range on the release branches; it reports without gating the release. Co-Authored-By: Claude Opus 5.5 --- .github/RELEASING.md | 5 +++- .github/workflows/commit-check.yml | 38 ++++++++++++++++++++++++++ AGENTS.md | 43 +++++++----------------------- aronrepo.config.js | 16 +++++++++++ 4 files changed, 67 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/commit-check.yml diff --git a/.github/RELEASING.md b/.github/RELEASING.md index c6f64241c..6e1ed8f4a 100644 --- a/.github/RELEASING.md +++ b/.github/RELEASING.md @@ -79,7 +79,10 @@ Before authorizing publication, retain: release branch. [Aronrepo](https://github.com/1aron/aronrepo/tree/main/packages/aronrepo) decides the version, tag and notes from the commits since the channel's last `v*` tag with this repository's `explicit` policy, the same rules as the commit -hook, the PR title check and `bun x aronrepo explain`. The script then runs +hook, the PR title check, the pushed-commit check (`commit-check.yml`) and +`bun x aronrepo explain`. Only commits that change the release paths in +`aronrepo.config.js` (every package, the Rust crates and the build +configuration that compiles them) release a version. The script then runs workspace publication, the cohort promotion next, and GitHub release creation last, with the assets in `aronrepo.config.js`. The workspace module publishes dependencies before their dependents, including optional and peer dependencies diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml new file mode 100644 index 000000000..e9f97c4c4 --- /dev/null +++ b/.github/workflows/commit-check.yml @@ -0,0 +1,38 @@ +name: Check pushed commits +on: + push: + branches: [main, alpha, beta, rc, canary] + +permissions: + contents: read + +jobs: + check: + # The commit hook and the PR title check already apply this policy; a direct push can skip + # both (--no-verify, rebuilt or web-edited commits), so check every pushed commit again here. + # It reports without gating the release, which resolves such a commit to no release anyway. + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + persist-credentials: false + # Only aronrepo runs here, so skip husky and every package postinstall. + - uses: ./.github/actions/setup-bun + with: + turbo-cache: "false" + ignore-scripts: "true" + - name: Check every pushed commit against the release policy + env: + BEFORE: ${{ github.event.before }} + AFTER: ${{ github.sha }} + run: | + set -euo pipefail + # A new branch has no previous tip, and a force push may drop it; check the head commit then. + if [[ "$BEFORE" =~ ^0+$ ]] || ! git cat-file -e "${BEFORE}^{commit}" 2>/dev/null; then + from="${AFTER}~1" + else + from="$BEFORE" + fi + bun x aronrepo check --from "$from" --to "$AFTER" diff --git a/AGENTS.md b/AGENTS.md index b34f4d199..830e102dd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -137,40 +137,15 @@ Non-release defaults: Only changes to these files can release a version: -- `packages/astro/**` -- `packages/binding/**` -- `packages/binding-darwin-arm64/**` -- `packages/binding-darwin-x64/**` -- `packages/binding-linux-arm64-gnu/**` -- `packages/binding-linux-arm64-musl/**` -- `packages/binding-linux-x64-gnu/**` -- `packages/binding-linux-x64-musl/**` -- `packages/binding-wasm-compiler/**` -- `packages/binding-wasm-engine/**` -- `packages/binding-wasm-tooling/**` -- `packages/binding-win32-arm64-msvc/**` -- `packages/binding-win32-x64-msvc/**` -- `packages/cli/**` -- `packages/compiler/**` -- `packages/create/**` -- `packages/css/**` -- `packages/css-sv/**` -- `packages/eslint-config/**` -- `packages/eslint-plugin/**` -- `packages/language-server/**` -- `packages/language-service/**` -- `packages/mcp/**` -- `packages/next/**` -- `packages/nuxt/**` -- `packages/preset/**` -- `packages/runtime/**` -- `packages/schema/**` -- `packages/server/**` -- `packages/svelte/**` -- `packages/tooling/**` -- `packages/vite/**` -- `packages/vscode/**` -- `packages/webpack/**` +- `packages/**` +- `!packages/*/playground/**` +- `crates/**` +- `!crates/xtask/**` +- `!crates/**/tests.rs` +- `Cargo.toml` +- `Cargo.lock` +- `rust-toolchain.toml` +- `shared/tsdown-package.config.ts` Excluding: `**/tests/**`, `**/test/**`, `**/__tests__/**`, `**/*.{test,spec}.*`, `**/*.test-d.*`, `**/__snapshots__/**`, `**/__fixtures__/**`, `**/__mocks__/**`, `**/fixtures/**`, `**/benchmarks/**`, `**/examples/**`, `**/CHANGELOG.md`, `.github/**`, `.husky/**`. diff --git a/aronrepo.config.js b/aronrepo.config.js index c0645283c..dbb3dae09 100644 --- a/aronrepo.config.js +++ b/aronrepo.config.js @@ -3,6 +3,22 @@ export default { release: { // Only the owner raises minor and major versions, with Bump(Minor) and Bump(Major) commits. mode: 'explicit', + // Files whose changes ship to npm, so only their commits may use a release type. + // Derived paths would cover public packages only, but the Rust crates compile into the + // binding packages and the private internal and engine-js workspaces are bundled into them. + paths: { + include: [ + 'packages/**', + '!packages/*/playground/**', + 'crates/**', + '!crates/xtask/**', + '!crates/**/tests.rs', + 'Cargo.toml', + 'Cargo.lock', + 'rust-toolchain.toml', + 'shared/tsdown-package.config.ts' + ] + }, // scripts/release.mjs attaches these to the GitHub release after npm promotion. assets: [ { path: 'release-artifacts/release-notes.md', name: 'release-notes-{tag}.md', label: 'Complete release notes' },