Setup automated publishing to NPM #7
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 PR configures automated publishing of this package to NPM under
@pulsar-edit/less-cache.This is the demo attempt at finalizing how we will do this organization wide.
The one none-standard thing here is that the secret we are using
NPM_PUBLISH_TOKENhas been added on an organization level.Pros: This means we only have to manage and update a single token to handle all package publications. With that we could setup stricter expiration rules without demanding too much work to keep them valid.
Cons: This does reduce security by having the token be able to make changes cross all packages.
To mitigate the cons listed above, the token is only being allowed to selected repositories. Meaning we have to ensure that a repo is on it's list before being able to use the token. As of now this repository is the only one configured to have access to this token.
How to actually publish
You may notice that I didn't opt to publish on commits or PRs, I thought it'd be too much of a headache to require any contributors to keep to specific semantics of their commit messages. Instead it seems to make more sense to me that we publish on a release being created.
So if we want to publish a new version no code changes are needed, just create a new release on the releases page. This does require that you've also updated the version in the
package.jsonof the repository.@savetheclocktower