Skip to content

fix: changeset PR creation and add LICENSE #23

fix: changeset PR creation and add LICENSE

fix: changeset PR creation and add LICENSE #23

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
name: Check, build & test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for changeset
if: github.event_name == 'pull_request'
run: |
if ! git diff --name-only origin/main...HEAD | grep -qE '^\.changeset/.+\.md$'; then
echo "No changeset file found in this PR."
echo "Run 'pnpm changeset' to create one before merging."
exit 1
fi
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint commit messages
if: github.event_name == 'pull_request'
run: pnpm exec commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
- name: Lint & format (biome check)
run: pnpm check
- name: Type-check & build
run: pnpm build
- name: Test
run: pnpm test
release:
name: Release
needs: ci
runs-on: ubuntu-latest
if: github.event_name == 'push'
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Authenticate with npm registry
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create release PR or publish
uses: changesets/action@v1
with:
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}