Skip to content

fix: silence expected HDF5 probe errors in snapshot walk #6

fix: silence expected HDF5 probe errors in snapshot walk

fix: silence expected HDF5 probe errors in snapshot walk #6

Workflow file for this run

name: Publish npm
# Publish @ioai/hdf5 when a SemVer tag is pushed (e.g. v0.1.0).
#
# Auth: NPM_TOKEN must be available to this job. If the token lives under
# Settings → Environments → "<name>" → Environment secrets, set
# `jobs.publish.environment` below to that exact "<name>" (default: npm).
# Repository-level secrets work without `environment:`.
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-*'
permissions:
contents: read
jobs:
publish:
runs-on: ubuntu-latest
# Required when NPM_TOKEN is stored as an *Environment* secret (not repo secret).
# Must match the environment name in GitHub (Settings → Environments).
environment: npm
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: https://registry.npmjs.org
cache: npm
- name: Cache HDF5 / zlib sources and WASM build trees
uses: actions/cache@v4
with:
path: |
.cache/sources
.cache/build-wasm
key: hdf5-wasm-official-${{ hashFiles('scripts/hdf5-source-pin.env', 'scripts/fetch-hdf5-source.sh', 'scripts/docker-emcc-full.sh', 'scripts/build-full-wasm-docker.sh', 'scripts/patches/hdf5-1.14.6-H5Tinit_float-fe-invalid.patch', 'scripts/wasm-node-smoke.mjs') }}
restore-keys: |
hdf5-wasm-official-
- name: Install dependencies
run: npm ci
- name: Build production WASM (Docker + Emscripten)
run: bash scripts/build-full-wasm-docker.sh
# Docker runs as root; bind-mounted paths become root-owned → tsc cannot write dist/.
- name: Restore workspace ownership after Docker
run: sudo chown -R "$(id -u):$(id -g)" "$GITHUB_WORKSPACE"
- name: TypeScript build
run: npm run build
# Same as CI: integration check on the WASM produced above (no second build).
- name: Validate WASM in Node (real fixtures)
run: npm run smoke:wasm
- name: Lint & test
run: npm run lint && npm run test
- name: Verify tag matches package.json version
run: |
set -euo pipefail
TAG="${GITHUB_REF_NAME}"
VER="${TAG#v}"
PKG="$(node -p "require('./package.json').version")"
if [[ "${VER}" != "${PKG}" ]]; then
echo "Git tag ${TAG} implies version ${VER}, but package.json has ${PKG}. Bump package.json or retag." >&2
exit 1
fi
- name: Publish to npm
run: |
if [ -z "${NODE_AUTH_TOKEN:-}" ]; then
echo "NODE_AUTH_TOKEN is empty. Add repo secret NPM_TOKEN, or add it to a GitHub Environment and set jobs.publish.environment to that environment name." >&2
exit 1
fi
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}