ci: publish workflow via changesets #5038
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR creates a new workflow to publish the npm packages in this repository.
It uses changesets for versioning, which calls the command
changeset version
. This command, under the hoods, removes all the changesets, generates/updates theCHANGELOG.md
files, and updates allpackage.json
files.The release workflow will be only one instead of two (we have one for
@biomejs/js-api
and@biomejs/biome
). However, I created various steps that handle them separately.The code that does the building and publishing is copied from the existing workflows (release_cli.yml and release_js_api.yml), so they work and are battle-tested. However, these jobs are only triggered if the package.json files are changed.
I also updated the
generate-manifest.mjs
file, as we don't need to generate any manifest anymore, we just need to patch them when we runwasm-pack
, and copy the binaries.Important
With this change, the git tags will change. For example, the CLI tags are published as
cli/v1.9.4
. After v2, the release tag will be@biomejs/[email protected]
. More generally<PACKAGE_NAME>@<VERSION>
. This means we will need to updatesetup-biome
and the VSCode extension to use this new format. cc @nhedgerRegarding the artefacts, since we don't use a github action anymore, as changesets GH action takes care for publishing the releases, I used a different approach to upload the binaries. Mainly, we use the
gh
CLI:I tested the first command locally, and it works as expected. As for the
gh release upload
, it should work, but we will know it once it will run.Regarding the
CHANGELOG.md
that we currently have in the root of the repository, I renamed toCHANGELOG_v1.md
, created a symbolic link to the newCHANGELOG.md
file that is placed underpackages/@biomejs/biome
.Next changes
There are still changes that we have inside the
## Unreleased
section of our changelog, I will make a PR to add them as separate changesets and remove them fromCHANGELOG_v1.md
Test Plan
I suppose I need some pairs of eyes to make sure I got this right.
Locally, I also run the command
changeset version
, and I made sure that all versions are correctly updated and synchronized.