Files
zeekayandHanzo Dev bd37e9ae4d ci: install with pnpm, and pull the mirror into the forge
publish still ran npm ci, which cannot work since 11ea83d moved the repo to
pnpm and deleted package-lock.json — the next version bump would have failed at
install. It installs with pnpm now and gates on pnpm test, which builds dist/
and then runs the suite.

sync-from-github pulls the mirror every 10m, fast-forward only. Nothing carried
refs here after the GitHub-side push was deleted.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-27 21:51:08 -07:00

51 lines
1.6 KiB
YAML

name: publish
# Publishes @hanzo/brand when the version in package.json changes on main.
# A version already on the registry is skipped, so re-runs are safe.
on:
push:
branches: [main]
paths: ['package.json']
workflow_dispatch:
permissions:
contents: read
jobs:
publish:
runs-on: hanzo-build-linux-amd64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org/
- name: Skip if already published
id: check
run: |
NAME=$(jq -r .name package.json)
VER=$(jq -r .version package.json)
if curl -fsSL "https://registry.npmjs.org/$NAME/$VER" > /dev/null 2>&1; then
echo "$NAME@$VER already on registry; skipping"
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
# `test` builds dist/ and then gates on the suite — one command for both.
# dist/ is gitignored, so publishing without it ships a package whose every
# subpath 404s. corepack takes the pnpm version from packageManager.
- name: Test
if: steps.check.outputs.skip != 'true'
run: |
corepack enable
pnpm install --frozen-lockfile
pnpm test
- name: Publish
if: steps.check.outputs.skip != 'true'
# npm, not pnpm: pnpm publish adds git checks a CI checkout fails.
# --no-provenance: a token publish 422s without it.
run: npm publish --access public --no-provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}