Skip to content

fix: make task recovery identity test portable #32

fix: make task recovery identity test portable

fix: make task recovery identity test portable #32

Workflow file for this run

name: Publish to npm
on:
push:
tags:
- "v*"
concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24.17.0
registry-url: https://registry.npmjs.org
package-manager-cache: false
- name: Verify tag matches package.json version
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
PKG_VERSION=$(node -p "require('./package.json').version")
if [ "${TAG_VERSION}" != "${PKG_VERSION}" ]; then
echo "Tag v${TAG_VERSION} does not match package.json version ${PKG_VERSION}"
exit 1
fi
- name: Install dependencies
run: npm ci
- name: Run package release checks
shell: bash
run: |
set -euo pipefail
PLAN_DIGEST="$(
node scripts/run-validation.js --route package-release --plan --json |
node -e 'const fs = require("fs"); const envelope = JSON.parse(fs.readFileSync(0, "utf8")); const plan = envelope?.data?.plan; const digest = plan?.budgetCard?.digest; if (envelope?.ok !== true || plan?.routeResolved !== "package-release" || plan?.candidateStable !== true || !/^[a-f0-9]{64}$/.test(String(digest || ""))) process.exit(1); process.stdout.write(digest)'
)"
node scripts/run-validation.js --route package-release --approve-plan "${PLAN_DIGEST}"
- name: Preview package contents
run: npm pack --dry-run
- name: Publish
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}