From a9dedcacf9ab69c3fef6c3edb1c73f74f95fcdbc Mon Sep 17 00:00:00 2001 From: steckes Date: Mon, 7 Sep 2026 22:31:14 +0200 Subject: [PATCH 1/2] Release on a version tag instead of a commit message Publishing was gated on the message of the commit pushed to main matching a version number, with all tags ignored. That only works when the release commit is the version bump itself; the 0.24.0 bump landed inside the rewrite PR, so there was no way left to trigger a release short of an artificial commit. Trigger on `x.y.z` and `vx.y.z` tags and run `publish` only for those. The tag is checked against package.json before publishing, since npm takes the version from there and a mismatch would ship something other than what was tagged. `paths-ignore` is dropped rather than kept: GitHub evaluates path filters for tag pushes too, and a tag on a commit already pushed to main carries no changed files, so the filter would skip the release run. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/CI.yml | 34 +++++++++++++++------------------- DEVELOPMENT.md | 35 +++++++++++++++++++++++++++++++++++ README.md | 19 ++----------------- 3 files changed, 52 insertions(+), 36 deletions(-) create mode 100644 DEVELOPMENT.md diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0c35a9c..0fa69b0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,14 +11,9 @@ permissions: push: branches: - main - tags-ignore: - - '**' - paths-ignore: - - '**/*.md' - - LICENSE - - '**/*.gitignore' - - .editorconfig - - docs/** + tags: + - '[0-9]+.[0-9]+.[0-9]+*' + - 'v[0-9]+.[0-9]+.[0-9]+*' pull_request: null concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -356,6 +351,7 @@ jobs: run: test -s example-input_enhanced.wav publish: name: Publish + if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest needs: - lint @@ -386,18 +382,18 @@ jobs: shell: bash - name: Publish run: | - npm config set provenance true - if git log -1 --pretty=%B | grep "^v\?[0-9]\+\.[0-9]\+\.[0-9]\+$"; - then - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - npm publish --access public - elif git log -1 --pretty=%B | grep "^v\?[0-9]\+\.[0-9]\+\.[0-9]\+"; - then - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - npm publish --tag next --access public - else - echo "Not a release, skipping publish" + VERSION="${GITHUB_REF_NAME#v}" + PACKAGE_VERSION="$(node -p "require('./package.json').version")" + if [ "$VERSION" != "$PACKAGE_VERSION" ]; then + echo "::error::Tag $GITHUB_REF_NAME does not match package.json version $PACKAGE_VERSION" + exit 1 fi + npm config set provenance true + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + case "$VERSION" in + *-*) npm publish --tag next --access public ;; + *) npm publish --access public ;; + esac env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..98b4659 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,35 @@ +# Development + +Requires a recent Rust toolchain and Node 18+. + +```bash +pnpm install +pnpm build # release build; use build:debug while iterating +pnpm pretest # download model fixtures into __test__/data +AIC_SDK_LICENSE= pnpm test +``` + +The native library for the host target is downloaded during `cargo build`, so the first +build needs network access. + +To benchmark, point the harness at a model file: + +```bash +AIC_SDK_LICENSE= AIC_SDK_MODEL=__test__/data/.aicmodel pnpm bench +``` + +## Releasing + +The npm version tracks the version of the `aic-sdk` Rust crate it wraps. Bump +`package.json`, `Cargo.toml` (both the package version and the `aic-sdk` dependency) and +`Cargo.lock` together, add a `CHANGELOG.md` entry, and merge that to `main`. Then tag the +merge commit: + +```bash +git tag 0.24.0 && git push origin 0.24.0 +``` + +Pushing the tag builds all six targets, runs the tests and examples, and publishes to npm. +The tag must match the version in `package.json` or the publish step fails. A tag with a +prerelease suffix, such as `0.24.0-rc.1`, publishes under the `next` dist-tag instead of +`latest`. diff --git a/README.md b/README.md index 2c8801a..ab16910 100644 --- a/README.md +++ b/README.md @@ -302,23 +302,8 @@ Cleanup timing also affects native memory usage: ## Development -Requires a recent Rust toolchain and Node 18+. - -```bash -pnpm install -pnpm build # release build; use build:debug while iterating -pnpm pretest # download model fixtures into __test__/data -AIC_SDK_LICENSE= pnpm test -``` - -The native library for the host target is downloaded during `cargo build`, so the first -build needs network access. - -To benchmark, point the harness at a model file: - -```bash -AIC_SDK_LICENSE= AIC_SDK_MODEL=__test__/data/.aicmodel pnpm bench -``` +Building, testing, benchmarking and releasing this package are covered in +[DEVELOPMENT.md](DEVELOPMENT.md). ## License From 8d6905ab696e7fdba7d1d6da9110cb44e37af0c3 Mon Sep 17 00:00:00 2001 From: steckes Date: Mon, 7 Sep 2026 22:40:02 +0200 Subject: [PATCH 2/2] remove version number --- DEVELOPMENT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 98b4659..d1b009d 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -26,7 +26,7 @@ The npm version tracks the version of the `aic-sdk` Rust crate it wraps. Bump merge commit: ```bash -git tag 0.24.0 && git push origin 0.24.0 +git tag x.x.x && git push origin x.x.x ``` Pushing the tag builds all six targets, runs the tests and examples, and publishes to npm.