Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automate workflow for npm publish #497

Merged
merged 9 commits into from
Feb 21, 2021
Merged

Conversation

amacado
Copy link
Member

@amacado amacado commented Feb 21, 2021

I created a workflow which will be triggered when a new release is created. The workflow will try to publish the latest version to npm.

When we want to create a new release, we need to update the package.json and package-lock.json and set it to the new release version. This can be done via the command (replace v2.9.0 with the new version):

npm version v2.9.0 -m "bump npm version to %s"

This should be done before development is merged into master and a new release is created. Otherwise the workflow will fail and throw this exception:

403 403 Forbidden - PUT https://registry.npmjs.org/devicon - You cannot publish over the previously published versions: xxx.

When this error occurs you need to checkout the branch, bump the version in the package.json and either publish the package manually or creating a new release to trigger the workflow again.

@amacado amacado added enhancement devops Use this label for devops related enhancements labels Feb 21, 2021
@amacado amacado linked an issue Feb 21, 2021 that may be closed by this pull request
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Member

@Thomas-Boi Thomas-Boi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey amacado,

The code looks good. I briefly wonder if we should make an action to automate this but we probably won't do releases that often to warrant that.

Good job on this feature. I totally forgot about it 😅

@amacado amacado merged commit bdf2627 into develop Feb 21, 2021
@amacado amacado deleted the amacado/feature/npm-publish branch February 21, 2021 22:02
@amacado amacado mentioned this pull request Feb 21, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops Use this label for devops related enhancements enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npm release
2 participants