k-skill/.github/workflows/release-npm.yml
Jeffrey (Dongkyu) Kim f8390ff95e
Add workflow_dispatch to release workflow and document changeset test anti-pattern (#51)
- Add workflow_dispatch trigger to release-npm.yml so releases can be
  manually re-triggered when the automatic path-based trigger misses.
- Document in CLAUDE.md and AGENTS.md that tests must never assert
  .changeset file existence, since changeset version consumes them.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:13:31 +09:00

51 lines
1.2 KiB
YAML

name: Release npm packages
on:
workflow_dispatch:
push:
branches:
- main
paths:
- ".changeset/**"
- ".github/workflows/release-npm.yml"
- "package-lock.json"
- "package.json"
- "packages/**"
permissions:
contents: write
pull-requests: write
id-token: write
# npm publishes authenticate with the repository-level NPM_TOKEN secret.
# id-token stays enabled so npm can still attach provenance when supported.
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm run ci
- name: Create npm release PR or publish changed packages
uses: changesets/action@v1
with:
version: npm run version-packages
publish: npm run release:npm
commit: "chore: version packages"
title: "chore: version packages"
createGithubReleases: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: "true"