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

GitHub Actions workflow to publish a new release on npm #541

Merged
merged 5 commits into from
Feb 13, 2024

Conversation

MisRob
Copy link
Member

@MisRob MisRob commented Feb 7, 2024

Description

Adds a GitHub Actions workflow that publishes a new release or pre-release on npm.

Also fixes package.json version.

Issue addressed

Part of #532

Reviewer guidance

  • Does code makes sense?
  • Are there some other steps that'd be useful to have implemented?

We will need to merge it and then I will make a new release to test it for this repository. I tested the same script in my playground repository here https://github.com/MisRob/hello-npm/blob/main/.github/workflows/npm-publish.yml and it went well https://www.npmjs.com/package/@robosovam/hello-npm?activeTab=versions.

Comments

I considered exploring having a package.json version increment guard, but actually the action will fail because npm doesn't allow publishing the same version twice as can be seen here https://github.com/MisRob/hello-npm/actions/runs/7799031860/job/21268937399, where I released v1.0.2, but didn't update package.json's v1.0.1.

Screenshot from 2024-02-07 08-33-51

So if I forgot, then I will get notified by this action failure and create a new patch with the correct package.json version. We have the version increment in the checklist now though, so hopefully this won't happen often.

Changelog

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical and brittle code paths are covered by unit tests
  • The change is described in the changelog section above

Reviewer guidance

  • Is the code clean and well-commented?
  • Are there tests for this change?
  • Are all UI components LTR and RTL compliant (if applicable)?

After review

  • The changelog item has been pasted to the CHANGELOG.md

@MisRob MisRob marked this pull request as ready for review February 7, 2024 07:40
@MisRob MisRob requested a review from rtibbles February 7, 2024 07:41
@MisRob MisRob added the TODO: needs review Waiting for review label Feb 7, 2024
Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

I think we should be subscribing to the published type. Everything else seems correct.

@MisRob MisRob requested a review from rtibbles February 13, 2024 13:43
@MisRob
Copy link
Member Author

MisRob commented Feb 13, 2024

Thank you @rtibbles, updated

@MisRob MisRob merged commit a705790 into learningequality:release-v3 Feb 13, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants