Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Distribute Custom Tools as Composite GitHub Actions (Without npm Publishing)

说明与用途

此方案展示如何将小型 Node CLI 工具作为 composite GitHub Actions 分发,无需 npm 发布,使用简单的 YAML 配置和 CI 标签验证。

问题

Publish small Node CLI tools without npm, avoiding account setup and publishing steps.

结果

The CLI becomes reusable via a simple uses: line, with CI verifying tag integrity, eliminating npm publishing overhead.

工作流

  • Create a repository for the CLI tool
  • Add action.yml with composite configuration and shell steps
  • Use actions/setup-node to install Node
  • Run npm ci and npm run build in the action's directory
  • Execute the tool via node with inputs
  • Commit the repository
  • Tag releases with v1.0.0 and a working v1 tag
  • Push tags to origin
  • Add a CI job that checks the action locally and with the published tag
  • Optional: publish to GitHub Marketplace after refining description

证据

Composite run steps will error if you do not specify shell: for each one.

来源

Exit codes directly determine CI pass/fail.

来源

Add a job to CI that references the published tags.

来源

  • 记录日期: 2026-09-09T01:00:27.708Z