Fix release job to use pnpm's built-in publish function #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The release job was failing because it was using
changeset publishdirectly instead of leveraging pnpm's built-in publish function. According to the pnpm documentation for using changesets, the recommended approach for pnpm workspaces is to usepnpm -r publishand let the changesets action call it through a release script.Solution
Updated the release configuration to follow pnpm's official documentation:
package.json:
.github/workflows/publish.yml:
Why This Fixes the Issue
Follows Official Guidelines: The pnpm docs explicitly recommend using
pnpm -r publishinstead ofchangeset publishfor workspace scenarios.Leverages pnpm's Native Features:
pnpm -r publishuses pnpm's optimized recursive publishing for monorepos, which properly handles workspace dependencies and publishing order.Simpler and More Maintainable: Delegates publishing logic to pnpm rather than relying on changesets to handle workspace-specific publishing.
Correct Build Flow: The workflow already builds packages before the changesets action runs (line 38-39), so the build step was correctly moved out of the release script to avoid redundancy.
How It Works Now
pnpm -r --filter="@supergrain/*" build)pnpm releasepnpm releaserunspnpm -r publishThis aligns with pnpm's best practices and should resolve the release job failures.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.