nodejs-npm-auto-release
Node.js NPM Auto Release
Overview
Provide a repeatable workflow to prepare, verify, and ship npm packages with a combined auto-version-and-publish GitHub Action, plus local checks before push.
Setup Checklist
- Add release scripts in
package.json
{
"scripts": {
"release:patch": "npm version patch -m \"chore(release): v%s\"",
"release:minor": "npm version minor -m \"chore(release): v%s\"",
"release:major": "npm version major -m \"chore(release): v%s\""
}
}
- Add
.npmignoreto keep packages clean
Typical entries:
.github/.claude/docs/tests/.envnode_modules/
- Add the combined workflow file
Create .github/workflows/auto-version-publish.yml with:
name: auto version and publish
on:
push:
branches:
- main
permissions:
contents: write
id-token: write
jobs:
release:
if: ${{ !contains(github.event.head_commit.message, 'chore(release):') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: |
npm ci
- name: Typecheck
run: |
npm run typecheck
- name: Test
run: |
npm test
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Bump patch version and tag
run: |
npm version patch -m "chore(release): v%s [skip ci]"
- name: Push version bump and tag
run: |
git push origin HEAD:main --follow-tags
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm publish --access public
- Set GitHub secret
Add NPM_TOKEN in repo Secrets with publish permission.
Release Workflow
- Local checks
npm run typecheck
npm test
npm pack --dry-run
- Commit and push
git add -A
git commit -m "feat: update package"
git push origin main
- Verify release
- Ensure
auto version and publishworkflow succeeds - Confirm new tag created
- Confirm npm version:
npm view <package-name> version
Notes
- Auto-release skips commits containing
chore(release):to avoid loops. - If you need manual bump, use
npm run release:patchthen push tags.
More from hhx465453939/claude_skill_pool
code-debugger
基于深度上下文理解的代码调试与增量开发流程。用于修复 Bug、性能问题、变量追踪或在既有模块上做增量功能时,需要建立调用链/变量依赖并维护 `.debug/` 记录的场景。
16pubmed-linker
This skill should be used when the user asks to "update PubMed links", "check reference links", "find PubMed URLs", "download fulltext papers", or discusses PubMed/Medline literature search and reference management. Provides systematic approach for querying PubMed database and updating reference lists with accurate links.
11research-analyst-system
宏观投资研究的多层级分析师 Agent 系统。首席分析师协调 6 大研究小组(内资股票、外资股票、大宗商品、加密货币、中国宏观、美国宏观),每小组可分配多名研究员并行深度调研,最终汇总为结构化研究报告。
10debug-ui
顶级 UI 设计师模式,兼具艺术灵感与工程实现。以产品审美 (Vibe) 为核心驱动,将模糊的感性描述转化为精准的 CSS/Design Token,并在 .debug/ 目录维护设计决策 (ADR)。
9paper-submission-manager
End-to-end manuscript-to-submission workflow management for academic papers. Use when preparing a manuscript for journal submission, assembling submission packages, aligning with journal instructions, creating cover letters/forms, validating figures/tables, or coordinating post-submission tracking in this repository.
9ai-spec
将自然语言需求转换为生产级技术规范与 AI 执行指令。用于需求不清晰、需要架构选型、需要完整技术规格或可执行任务清单时。
8