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 NPM package releases #1119

Merged
merged 4 commits into from
Feb 11, 2023
Merged

Automate NPM package releases #1119

merged 4 commits into from
Feb 11, 2023

Conversation

Juice10
Copy link
Contributor

@Juice10 Juice10 commented Feb 9, 2023

Use changesets to automate all npm package releases.

Todo before of after merge

  • Add NPM authentication token as a secret to the repository with the name NPM_TOKEN
  • Add Changesets GitHub bot to this repository

Edit: for more info on how this works see #1119 (comment) or https://github.com/changesets/changesets

@Juice10 Juice10 changed the title Automate releases Automate NPM package releases Feb 9, 2023
id: changesets
uses: changesets/action@v1
with:
publish: yarn run release
Copy link
Member

Choose a reason for hiding this comment

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

I just want to make sure this command will publish the package directly or create a pull request first?
I feel that it's safer to create a pull request first rather than directly publish packages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will create a PR first, once that PR is accepted it will publish the packages on NPM. Also if a PR already exists and more code is added to master the release command will update the PR with the new changes.

Copy link
Member

@YunFeng0817 YunFeng0817 Feb 11, 2023

Choose a reason for hiding this comment

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

I saw Matt's youtube video and I found that he only build the package here rather than publishing them. So I'm guessing ChangeSets will execute changesets publish for us rather than we manually do it?
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried that myself on https://GitHub.com/Juice10/rrweb and it didn’t work. Also looking at the changesets documentation and some projects using changesets this seems like the way to go. Looks like a mistake in Matt’s video

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the explanation!

@YunFeng0817
Copy link
Member

Changesets will really help us publish packages much faster. Currently, our publishing period is much longer than the average of npm packages. I believe this tool will change the situation.

@Yuyz0112
Copy link
Member

I think I've done the TODOs, feel free to ping me on slack or here if there is something missing.

@@ -36,15 +36,16 @@ export class RRWindow {

export class RRDocument
extends BaseRRDocumentImpl(RRNode)
implements IRRDocument {
implements IRRDocument
{
Copy link
Contributor

Choose a reason for hiding this comment

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

These are formatting changes unrelated to changesets?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: npm release via GitHub actions
4 participants