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
38 changes: 30 additions & 8 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,37 @@ on:
branches:
- main
- release
paths-ignore:
- "**/*.md"
- "LICENSE"
- "benchmarks/**"
paths:
- "packages/**"
- "examples/**"
- "tests/**"
- "package.json"
- "package-lock.json"
- "tsconfig.base.json"
- "tsconfig.dev.json"
- "eslint.config.base.mjs"
- "docker-compose.yml"
- "vitest.node.config.ts"
- "vitest.node.setup.ts"
- "vitest.web.config.ts"
- "vitest.web.setup.ts"
- ".github/workflows/examples.yml"
Comment on lines +19 to +24
pull_request:
paths-ignore:
- "**/*.md"
- "LICENSE"
- "benchmarks/**"
paths:
- "packages/**"
- "examples/**"
- "tests/**"
- "package.json"
- "package-lock.json"
- "tsconfig.base.json"
- "tsconfig.dev.json"
- "eslint.config.base.mjs"
- "docker-compose.yml"
- "vitest.node.config.ts"
- "vitest.node.setup.ts"
- "vitest.web.config.ts"
- "vitest.web.setup.ts"
- ".github/workflows/examples.yml"
Comment on lines +35 to +40

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
Expand Down
153 changes: 153 additions & 0 deletions .github/workflows/publish-skill-rowbinary-parser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: "publish: rowbinary parser"

# Independent publish + release for the standalone @clickhouse/rowbinary
# package (the RowBinary parser skill). It is NOT part of the npm workspace
# lockstep release driven by publish.yml — it carries its own version in
# skills/clickhouse-js-node-rowbinary-parser/package.json and ships on its own
# cadence. Triggered manually, and — like publish.yml — must be dispatched from
# the `release` branch: the npm-publish environment is protected so only that
# branch may deploy (the repo's human-in-the-loop release gate). Dispatches from
# any other ref are skipped by the job-level `if` guard below. The `publish` job
# gates on typecheck/test/build, publishes the version currently in package.json
# with the "latest" tag using npm OIDC authentication and provenance, then pushes
# a matching git tag. The `e2e` job waits for the freshly published version to
# appear on the registry and verifies it installs and imports in a throwaway
# downstream project across the supported Node versions.

permissions:
contents: read
id-token: write # Required for npm OIDC authentication and provenance

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

on:
workflow_dispatch:

jobs:
publish:
# The npm-publish environment only permits the release branch to deploy;
# skip cleanly on any other ref instead of failing the protection check.
if: github.ref == 'refs/heads/release'
runs-on: ubuntu-latest
timeout-minutes: 10
environment: npm-publish
permissions:
contents: write # Required to push the release git tag
id-token: write # Required for npm OIDC authentication and provenance
defaults:
run:
working-directory: skills/clickhouse-js-node-rowbinary-parser
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm ci

- name: Typecheck
run: npm run typecheck

- name: Test
run: npm test

- name: Build
run: npm run build

- name: Get the release version
id: version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "Publishing @clickhouse/rowbinary@$VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Publish to npm
# prepack copies the repo-root LICENSE and rebuilds dist before packing.
run: npm publish --access public --provenance

- name: Create and push release git tag
env:
RELEASE_TAG: rowbinary-v${{ steps.version.outputs.version }}
RELEASE_VERSION: ${{ steps.version.outputs.version }}
run: |
if git ls-remote --exit-code --tags origin "refs/tags/${RELEASE_TAG}" >/dev/null 2>&1; then
echo "Tag ${RELEASE_TAG} already exists on origin; skipping."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -a "${RELEASE_TAG}" -m "Release @clickhouse/rowbinary ${RELEASE_VERSION}"
git push origin "refs/tags/${RELEASE_TAG}"

e2e:
name: e2e (node ${{ matrix.node }})
needs: publish
if: needs.publish.result == 'success'
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: true
matrix:
node: [20, 22, 24]
env:
PUBLISHED_VERSION: ${{ needs.publish.outputs.version }}
steps:
- name: Setup NodeJS ${{ matrix.node }}
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ matrix.node }}
registry-url: "https://registry.npmjs.org"

- name: Wait for @clickhouse/rowbinary@${{ needs.publish.outputs.version }} on npm
run: |
set -euo pipefail
if [ -z "${PUBLISHED_VERSION}" ]; then
echo "PUBLISHED_VERSION is empty; cannot wait for npm publication." >&2
exit 1
fi
pkg="@clickhouse/rowbinary"
# Poll the registry for up to ~5 minutes. New versions usually surface
# in seconds, but the registry CDN can lag.
max_attempts=60
sleep_seconds=5
attempt=1
echo "Waiting for ${pkg}@${PUBLISHED_VERSION} to be available on npm..."
while true; do
if npm view "${pkg}@${PUBLISHED_VERSION}" version >/dev/null 2>&1; then
echo " ${pkg}@${PUBLISHED_VERSION} is available."
break
fi
if [ "$attempt" -ge "$max_attempts" ]; then
echo "Timed out waiting for ${pkg}@${PUBLISHED_VERSION} on npm" >&2
exit 1
fi
echo " attempt ${attempt}/${max_attempts}: not available yet, sleeping ${sleep_seconds}s..."
attempt=$((attempt + 1))
sleep "$sleep_seconds"
done

- name: Install and import the published package
run: |
set -euo pipefail
work="$(mktemp -d)"
cd "$work"
npm init -y >/dev/null 2>&1
npm install "@clickhouse/rowbinary@${PUBLISHED_VERSION}"
# Verify both the main barrel entry and a subpath export resolve and
# expose their parsers to a downstream consumer.
node --input-type=module -e "
import * as rb from '@clickhouse/rowbinary';
import * as ints from '@clickhouse/rowbinary/integers';
if (typeof rb.readRows !== 'function') throw new Error('readRows missing from main export');
if (typeof ints.readUInt8 !== 'function') throw new Error('readUInt8 missing from subpath export');
console.log('OK: @clickhouse/rowbinary@${PUBLISHED_VERSION} imports cleanly');
"
37 changes: 29 additions & 8 deletions .github/workflows/tests-bun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,36 @@ on:
push:
branches:
- main
paths-ignore:
- "**/*.md"
- "LICENSE"
- "benchmarks/**"
- release
paths:
- "packages/**"
- "tests/**"
- "package.json"
- "package-lock.json"
- "tsconfig.base.json"
- "tsconfig.dev.json"
- "eslint.config.base.mjs"
- "docker-compose.yml"
- "vitest.node.config.ts"
- "vitest.node.setup.ts"
- "vitest.web.config.ts"
- "vitest.web.setup.ts"
- ".github/workflows/tests-bun.yml"
Comment on lines +18 to +23
pull_request:
paths-ignore:
- "**/*.md"
- "LICENSE"
- "benchmarks/**"
paths:
- "packages/**"
- "tests/**"
- "package.json"
- "package-lock.json"
- "tsconfig.base.json"
- "tsconfig.dev.json"
- "eslint.config.base.mjs"
- "docker-compose.yml"
- "vitest.node.config.ts"
- "vitest.node.setup.ts"
- "vitest.web.config.ts"
- "vitest.web.setup.ts"
- ".github/workflows/tests-bun.yml"
Comment on lines +33 to +38

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
Expand Down
37 changes: 29 additions & 8 deletions .github/workflows/tests-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,36 @@ on:
push:
branches:
- main
paths-ignore:
- "**/*.md"
- "LICENSE"
- "benchmarks/**"
- release
paths:
- "packages/**"
- "tests/**"
- "package.json"
- "package-lock.json"
- "tsconfig.base.json"
- "tsconfig.dev.json"
- "eslint.config.base.mjs"
- "docker-compose.yml"
- "vitest.node.config.ts"
- "vitest.node.setup.ts"
- "vitest.web.config.ts"
- "vitest.web.setup.ts"
- ".github/workflows/tests-node.yml"
Comment on lines +18 to +23
pull_request:
paths-ignore:
- "**/*.md"
- "LICENSE"
- "benchmarks/**"
paths:
- "packages/**"
- "tests/**"
- "package.json"
- "package-lock.json"
- "tsconfig.base.json"
- "tsconfig.dev.json"
- "eslint.config.base.mjs"
- "docker-compose.yml"
- "vitest.node.config.ts"
- "vitest.node.setup.ts"
- "vitest.web.config.ts"
- "vitest.web.setup.ts"
- ".github/workflows/tests-node.yml"
Comment on lines +33 to +38

schedule:
- cron: "0 9 * * *"
Expand Down
37 changes: 29 additions & 8 deletions .github/workflows/tests-oss-dependents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,36 @@ on:
push:
branches:
- main
paths-ignore:
- "**/*.md"
- "LICENSE"
- "benchmarks/**"
- release
paths:
- "packages/**"
- "tests/**"
- "package.json"
- "package-lock.json"
- "tsconfig.base.json"
- "tsconfig.dev.json"
- "eslint.config.base.mjs"
- "docker-compose.yml"
- "vitest.node.config.ts"
- "vitest.node.setup.ts"
- "vitest.web.config.ts"
- "vitest.web.setup.ts"
- ".github/workflows/tests-oss-dependents.yml"
Comment on lines +18 to +23
pull_request:
paths-ignore:
- "**/*.md"
- "LICENSE"
- "benchmarks/**"
paths:
- "packages/**"
- "tests/**"
- "package.json"
- "package-lock.json"
- "tsconfig.base.json"
- "tsconfig.dev.json"
- "eslint.config.base.mjs"
- "docker-compose.yml"
- "vitest.node.config.ts"
- "vitest.node.setup.ts"
- "vitest.web.config.ts"
- "vitest.web.setup.ts"
- ".github/workflows/tests-oss-dependents.yml"
Comment on lines +33 to +38

schedule:
- cron: "0 9 * * *"
Expand Down
Loading
Loading