publish-package-cicd

Automate npm publishing for monorepos with Changesets and OIDC.

Updated Jan 14, 2026
One-click install
npx skills add https://github.com/primeinc/swarm --skill publish-package-cicd-primeinc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: publish-package-cicd
Source: https://github.com/primeinc/swarm/tree/main/.opencode/skill/publish-package-cicd
Command: npx skills add https://github.com/primeinc/swarm --skill publish-package-cicd-primeinc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the setup and execution of CI/CD npm publishing for monorepos by integrating Changesets with npm Trusted Publishers (OIDC). It eliminates manual publishing steps and reduces risk by handling version bumps, PR-based release flows, and secure publishing without npm tokens.

Core Features & Use Cases

  • Automates release workflows: Changesets-driven version bumps, PR creation, and automated publishing on merge.
  • OIDC-based trusted publishing: Configures npm authentication via GitHub Actions without exposing npm tokens.
  • Workspace protocol resolution: Uses a custom publish path to resolve workspace:* dependencies before publishing.
  • Monorepo optimization: Works across multiple packages and excludes non-published packages (docs, web) from the publish flow.
  • Troubleshooting guidance: Includes procedures for resolving common workspace and OIDC issues.
  • Reference resources: Examples and scripts for publish.ts, workflow, and changesets config.

Quick Start

  • Create a changeset file manually: cat > .changeset/your-change.md << 'EOF'

    "package-name": patch

    Describe the change EOF
  • Commit and push to main to trigger the Changesets workflow.
  • Merge the generated release PR to publish to npm using the CI workflow.

Frequently Asked Questions about publish-package-cicd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate npm publishing for a monorepo using Changesets and OIDC?

Automate npm publishing for a monorepo by integrating Changesets with npm Trusted Publishers. This configures GitHub Actions to handle version bumps and publish packages via OIDC, eliminating the need for manual npm tokens.

How do I resolve workspace:* dependencies before publishing to npm?

Resolve workspace:* dependencies before npm publish using a custom publish script. This script processes workspace protocol resolution during the CI workflow, ensuring published packages have correct semantic version ranges.

Can I use npm Trusted Publishers with Bun or Turborepo workflows?

Yes, npm Trusted Publishers work across Bun and Turborepo workflows. The OIDC-based trusted publishing integrates with GitHub Actions to authenticate securely without exposing npm tokens in either monorepo build system.

What is the best way to exclude non-published packages from a monorepo release flow?

Exclude non-published packages like docs or web apps from the monorepo release flow by configuring the publish script. This ensures only intended workspace packages are versioned and published to npm during the CI workflow.

Do I need an npm token to publish packages from GitHub Actions?

No, you do not need an npm token when using OIDC-based trusted publishing. The setup configures npm authentication directly through GitHub Actions OIDC, securing the publishing process without storing tokens as secrets.

Why does my Changesets release workflow fail to publish in a monorepo?

Changesets release workflows often fail due to unresolved workspace:* dependencies or incomplete Trusted Publisher setup on npm. The Skill includes troubleshooting procedures and reference scripts to resolve these OIDC and workspace issues.

Related Skills