Publish with changeset publish so releases are tagged - #158
Merged
Conversation
…skip published versions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes two problems in the release workflow by switching
release:publishfrompnpm publishtochangeset publish(the commandchangesets/actionis designed around).Problem 1 — releases ship without a git tag
changesets/actiontags the release commit and cuts the GitHub release only for packages it detects as published, and it detects them by grepping the publish command's stdout for theNew tag:lines that onlychangeset publishprints.pnpm publishprints neither, so the action saw nothing published and created no tag —v3.0.0had to be tagged by hand, and the first attempt to patch this around a custom step tagged the wrong commit (the action rewritespackage.json/the changesets in the working tree on every run, so the working tree can't tell the version-PR path from the publish path).Problem 2 — any no-release push to master fails
pnpm publisherrors with "cannot publish over the previously published version" whenever master is pushed without a new version to release.changeset publishinstead queries the registry per package and publishes only versions that aren't there yet, so such a push is a clean no-op. (This PR's own merge is exactly that case — a master push with3.0.1already on npm — so its release run passing green is the proof.)The change
release:publish:pnpm publish --no-git-checks --provenance→changeset publish.NPM_CONFIG_PROVENANCE=trueon the release step —changeset publishshells out topnpm publish, which reads it as--provenance(the job already hasid-token: write).No source or dist changes, so no changeset is required.