Repository navigation
ci: packaging smoke test + tag-driven npm release - #30
Merged
Merged
Conversation
test.yml gains a `package` job that packs the tarball, installs it into a throwaway project and invokes the bins the way a user does. Unit tests import the source tree; this is the only job that would have caught a bin that silently does nothing once installed. release.yml publishes on v* tags: it verifies the tag matches package.json, runs the suite, and skips cleanly if the version is already on the registry so re-runs and back-filled tags can't fail.
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.
Both files were held back from #29 because the push token lacked the
workflowscope. That's now resolved.test.yml— adds apackagejob alongside the existing Node 18/20/22 matrix. It runsnpm pack, installs the tarball into an empty project, and invokesastro-seo-toolkit,astro-seo-checkandastro-seo-sitemapthe way a user would, then asserts all four generated files are non-empty.This is the job that would have caught the original bug. Unit tests import the source tree, where the CLI guard compared equal; the failure only appears once the package is installed and npm runs the bin through a
node_modules/.binsymlink.release.yml— publishes onv*tags. It checks the tag againstpackage.json, runs the suite, and skips without failing when the version is already on the registry.Note the
NPM_TOKENsecret is not set yet, so the first tag push that needs to publish will fail at the publish step. Either add the secret or configure a trusted publisher on npmjs.com and drop theenvblock — the comment in the file explains both.