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

Use changeset to handle publishing of packages #959

Closed
4 tasks
bidoubiwa opened this issue Jan 25, 2023 · 1 comment
Closed
4 tasks

Use changeset to handle publishing of packages #959

bidoubiwa opened this issue Jan 25, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@bidoubiwa
Copy link
Contributor

bidoubiwa commented Jan 25, 2023

With the migration to #939 we need to change the way we handle publishes on github but also on npm.

The tool suggested by turborepo is changeset.

Changeset automates a lot of the tedious actions, for example updating the version manually or creating relevant information on what the PR does.

Changeset

Changing to changeset requires the contributor to add a changeset in its PR. A changeset A changeset is a piece of information about changes made in a branch or commit. It generates a unique file containing different information.

For example:

---
"@meilisearch/instant-meilisearch": minor
---

I did something in this PR

Version Update

When running changeset version all the files are merged into the CHANGELOG of the related package. In the case above it updates (or creates) the CHANGELOG of the @meilisearch/instant-meilisearch package (and not the others).

In our case it would generate this:

# @meilisearch/instant-meilisearch

## 0.11.0

### Minor Changes

- I did something

It also updates the version in the related package based on whether the changesets asked for a major, minor or patch update. In our case, we asked for a minor update, so the package.json of @meilisearch/instant-meilisearch has its version updated to 0.11.0.

Publish

Finally, based on the packages that saw their version updated, the publish function will only publish the affected packages.

Process

We want users to not use changeset publish or changeset version locally. This should be handled by the CI.
changesets has a dedicated github actionto handle that.

In this action we want the following:

  • On each push to main, the CI should update a PR it created with the updated changelogs and versions. Example
  • When the PR is merged, the CI should generate both a github release for the related packages (see example) and publish then on npm.

Todo

  • Add changesets configuration to the repo
  • Update the contributing guide with the new required changeset that has to be added on every PR
  • Update the publish CI to follow the process described above
  • Handle pre-releases and beta versions
@bidoubiwa bidoubiwa added the enhancement New feature or request label Jan 25, 2023
meili-bors bot added a commit that referenced this issue Feb 1, 2023
965: Add changesets publish process r=bidoubiwa a=bidoubiwa

This PR adds a release process for the packages.

Some documentation links are provided in the yaml to provide quick link to understand the commands.

A full explanation is provided in the CONTRIBUTING guide.

the `checkr-release.sh` and `check-tag-format.sh` scripts are removed.
The check-release is redundant as changesets takes care of updating the versions.
the check tag format is also removed as the CI will not trigger if the format is bad.




FIxes: #959 

Co-authored-by: Charlotte Vermandel <charlottevermandel@gmail.com>
@bidoubiwa
Copy link
Contributor Author

fixed by #965

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

No branches or pull requests

1 participant