As a contributor, when I open a PR I always have to remember to add the corresponding changeset (by using pnpm changeset)
The PR itself will run a job to build, lint and test the code. The maintainers of this repository can add this job as a required job to be able to merge the PR. In this way, if a PR does not pass any of the steps (build, check-format, lint, test) it won't be possible to merge it
When the PR is merged to the main branch, the changesets/action will find that there is a changeset file, and will open a PR to publish the package. This PR is the result of running pnpm changeset version on the code in the main branch.
If other PRs are merged from other contributors, the changesets files will accumulate and the PR opened at step 3 will be updated including all contributions
Once the maintainers are ready to release the package, they just have to merge the release PR. This time, the changesets/action, seeing that there is no changeset file anymore, will publish the package to NPM and create a release with the corresponding release notes in GitHub
For this to work it is necessary that:
The GITHUB_TOKEN is granted permissions to create and approve pull requests. This can be done in Settings -> Actions -> General -> Workflow permissions -> Allow GitHub Actions to create and approve pull requests
The maintainers create an NPM_TOKEN secret with an NPM token with write permissions to the organization (or at least the corresponding package, for publishing).
This PR is a proposal to introduced automated publishing of the package.
This should prevent problems like the ones observed in the last two minor versions of the package.
It uses the Changesets Release Action and works in the following way:
pnpm changeset
)changesets/action
will find that there is a changeset file, and will open a PR to publish the package. This PR is the result of runningpnpm changeset version
on the code in the main branch.changesets/action
, seeing that there is no changeset file anymore, will publish the package to NPM and create a release with the corresponding release notes in GitHubFor this to work it is necessary that:
GITHUB_TOKEN
is granted permissions to create and approve pull requests. This can be done inSettings
->Actions
->General
->Workflow permissions
->Allow GitHub Actions to create and approve pull requests
NPM_TOKEN
secret with an NPM token with write permissions to the organization (or at least the corresponding package, for publishing).