Skip to content

automate workflow for npm publish - #497

Merged
amacado merged 9 commits into
developfrom
amacado/feature/npm-publish
Feb 21, 2021
Merged

amacado merged 9 commits into
developfrom
amacado/feature/npm-publish

Conversation

@amacado

@amacado amacado commented Feb 21, 2021

Copy link
Copy Markdown
Member

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 Devops, devex and automation related enhancements labels Feb 21, 2021
@amacado
amacado requested a review from Thomas-Boi February 21, 2021 02:19
@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.

@Thomas-Boi Thomas-Boi left a comment

Copy link
Copy Markdown
Member

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 done
GCHQDeveloper926 pushed a commit to GCHQDeveloper926/devicon that referenced this pull request Dec 20, 2024
* setup npm_publish workflow and update package.json with new repo info

* refactoring npm publish workflow to reduce dependencies

* npm publish to 2.9.0

* reduce npm publish workflow to publishing task only

* npm publish to 2.9.0

* testing npm publish

* update npm version to 2.9.0 (latest release)

* enhance CONTRIBUTING.md with sentence about npm release workflow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops Devops, devex and automation related enhancements enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

npm release

2 participants