name: Release to npm (Reusable) on: workflow_call: permissions: id-token: write # Required for OIDC contents: write # Required for git tags jobs: release: runs-on: ubuntu-latest name: Release to npm steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: pnpm/action-setup@v6 - uses: actions/setup-node@v6 with: node-version: '24' cache: 'pnpm' registry-url: "https://registry.npmjs.org" - name: Install packages. run: pnpm install --frozen-lockfile - name: Set up project. run: pnpm run bootstrap - name: Run tests. run: USE_REACT_STRICT_MODE=0 pnpm run test:vitest - name: Release to NPM run: pnpm run release # Note: No env block needed - OIDC auth is automatic tag: needs: release if: "startsWith(github.event.head_commit.message, 'chore(release)')" runs-on: ubuntu-latest name: Tag release commit steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - name: Set up git identity run: git config --global user.name "instructure-ui-ci" && git config --global user.email "instructure-ui-ci@instructure.com" # -a -m is needed to make the tag "annotated". Lerna needs annotated tags to work correctly with verisons - name: Add tag run: git tag -a v$(./.github/workflows/calculateVersion.sh) -m v$(./.github/workflows/calculateVersion.sh) - name: Push tags run: git push origin v$(./.github/workflows/calculateVersion.sh)