ci: add changeset setup #6
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: Release | |
on: | |
push: | |
branches: | |
- main | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
permissions: {} # reset | |
jobs: | |
release: | |
name: Release | |
# IMPORTANT: prevent this action from running on forks | |
if: github.repository == 'fellipeutaka/kenji' | |
permissions: | |
contents: write # to create release (changesets/action) | |
pull-requests: write # to create pull request (changesets/action) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.12.2] # Same as the version in .nvmrc | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9.5.0 # Same as the version in package.json | |
- 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 --frozen-lockfile --ignore-scripts | |
- name: Build the CLI | |
run: pnpm run build --filter=kanpeki-ui | |
- name: Create Version PR or Publish to NPM | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
commit: "chore(release): version packages" | |
title: "chore(release): version packages" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |