name: CI on: push: branches: ['**'] # not tags pull_request: env: NPM_REGISTRY: https://verdaccio.harvmaster.com/ jobs: check: name: Node ${{ matrix.node }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: node: [22, 24, 26] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} cache: npm - run: npm ci - name: Format run: npm run format:check - name: Typecheck run: npm run typecheck - name: Test run: npm run test:only - name: Build run: npm run build # Pushes only (not pull requests): main → `latest`, next → `next`, other branches → `dev-`. # See scripts/publish.mjs. Needs the NPM_REGISTRY_TOKEN secret. staging: name: Publish to staging registry needs: check if: github.event_name == 'push' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 cache: npm - run: npm ci - name: Configure registry run: | host="${NPM_REGISTRY#https://}" printf 'registry=%s\n//%s:_authToken=${NPM_REGISTRY_TOKEN}\n' "$NPM_REGISTRY" "$host" > .npmrc - name: Publish run: node scripts/publish.mjs "${{ github.ref_name }}" env: NPM_REGISTRY_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}