Skip to content

fix: npm publish doesn't understand workspace:* #745

fix: npm publish doesn't understand workspace:*

fix: npm publish doesn't understand workspace:* #745

Workflow file for this run

name: Test & Release
on: [push, pull_request]
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
tests:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '18', '20' ]
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- run: pnpm install
- run: pnpm build
- run: pnpm test:packages
- run: pnpm lint
- run: pnpm lint:attw
- run: pnpm lint:publint
# Catches `workspace:`-style ranges that would ship to the registry
# uninstallable. publint and attw both pass such a manifest.
- run: pnpm lint:manifests
release:
name: Release
if: ${{ github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'beta') }}
needs: tests
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: '22.14.0'
# @semantic-release/npm bundles its own `npm` dependency, but under pnpm's
# dependency isolation that copy isn't reachable via execa's `preferLocal` from
# other packages - it falls back to whatever `npm` is on PATH. That needs to be
# recent enough to support Trusted Publishers (OIDC), hence installing it here
# explicitly rather than relying on whatever Node bundles.
- run: npm install -g npm@11
- run: pnpm install
- run: pnpm release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}