Enable publishing #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
jobs: | |
check: | |
name: π Check | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x, 22.x] | |
steps: | |
- name: π¦ Enable Corepack | |
run: corepack enable | |
- name: β¬οΈ Checkout | |
uses: actions/checkout@v4 | |
- name: π₯‘ Set up pnpm | |
uses: pnpm/action-setup@v4 | |
- name: π’ Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "pnpm" | |
- name: 𧩠Install dependencies | |
run: pnpm install | |
- name: ποΈ Build packages | |
run: pnpm build | |
- name: π΅οΈ Lint | |
run: pnpm lint | |
- name: π§ͺ Test | |
run: pnpm test | |
# Disabled until we can get Knip running cleanly. | |
# - name: Knip | |
# run: pnpm knip | |
release: | |
name: π Release | |
needs: check | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
strategy: | |
matrix: | |
node-version: [22.x] | |
steps: | |
- name: π¦ Enable Corepack | |
run: corepack enable | |
- name: β¬οΈ Checkout | |
uses: actions/checkout@v4 | |
- name: π₯‘ Set up pnpm | |
uses: pnpm/action-setup@v4 | |
- name: π’ Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "pnpm" | |
- name: 𧩠Install dependencies | |
run: pnpm install | |
- name: ποΈ Build packages | |
run: pnpm build | |
- name: π£ Create Release Pull Request or Publish to npm | |
uses: changesets/action@v1 | |
with: | |
commit: "Version packages π¦ [skip ci]" | |
title: "Version packages π¦" | |
publish: pnpm changeset publish | |
env: | |
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ env.NPM_TOKEN }} |