add workflow for publishing npm package #260
Merged
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.
This is a suggestion of an automated workflow for publishing npm packages.
Process for publishing the development tags would be:
x.y.z
x.y.z-dev.<commit-sha>
vx.y.z-dev.<commit-sha>
If this works well, we can trigger this workflow to run on push to main for a completely automated publishing flow.
Once the next release is ready you change the
npm dist tag
input tolatest
. Then the workflow doesx.y.z
to npm registryx.y.z
This can then also be easily extended to utilize https://cli.github.com/manual/gh_release_create for automatic github release creation with changelog.
Usage
If consumers of the library want to install the lastest dev version they would do:
They can also explicitly install the version from a commit using
To install the latest released version they would continue to use
Or simply use a version number
As long as they use a lock file, the version that they have installed in their project will not change unless they explicitly want to upgrade.
Discussion
In order to make this work, someone with push access to the npm package
signify-ts
needs to generate a publishing token and store in github secrets. These secrets are not accessible from forks.This would make it easier for consumers of this package to install and test the latest versions of the package without having to reference the repository and pull all devDependencies. It would also make it easier for maintainers to publish the packages.