Skip to content

FrontEndDev-org/publish-node-package-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

publish-node-package-action

release marketplace license

将 NodeJS 软件包发布到存储库

特性

  • 发布到 NPM 仓库,比 npm publish 更好用
  • 支持任意工程类型,如 MonoRepo、PolyRepo、SingleRepo
  • 支持任务包管理工具,如 npm、pnpm、yarn
  • 支持同步新版本到 npmmirror.com
  • 支持自动从根目录复制 License 到当前 package,如果当前没有的话
  • 支持自动从根目录复制 README.md 到当前 package,如果当前没有的话
  • 自动修剪 package.json 文件,删除多余的属性,如 devDependenciesscripts

发版到 NPM 仓库

jobs:
  publish-npm:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npm run build
      - uses: FrontEndDev-org/publish-node-package-action@v2
        with:
          token: ${{ secrets.NPM_TOKEN }}

入参

名称 必填 默认值 描述
token 授权令牌
registry https://registry.npmjs.org 包源地址
tag latest 要发布的版本标签,默认为 latest
dryRun false 模拟发布,但不实际上传到注册表
includePrivate false 同时发布私有包
disableProvenance false 禁用 npm 发布的来源证明
disableSync false 禁用同步到 npmmirror.com
disableStrip false 禁用删除包中不需要的键,如 scriptsdevDependencies
disableCopyLicense false 禁用复制根目录许可证文件(如果包没有的情况)
disableCopyReadme false 禁用复制根目录 README 文件(如果包没有的情况)
syncTimeout 30 同步超时时间(秒),默认为 30 秒

出错

About

Publish a NodeJS package to NPM Repository or GitHub Packages

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •