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

ci: publish workflow via changesets #5038

Merged
merged 4 commits into from
Feb 6, 2025
Merged

Conversation

ematipico
Copy link
Member

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 the CHANGELOG.md files, and updates all package.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 run wasm-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 update setup-biome and the VSCode extension to use this new format. cc @nhedger

Regarding 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:

files=$(ls biome-* | tr '\n' ' ')
gh release upload @biomejs/biome@${{ env.cli-version }} $files

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 to CHANGELOG_v1.md, created a symbolic link to the new CHANGELOG.md file that is placed under packages/@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 from CHANGELOG_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.

@github-actions github-actions bot added the A-Changelog Area: changelog label Feb 5, 2025
@ematipico ematipico requested review from a team February 5, 2025 12:19
Copy link
Contributor

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

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

Looks about right to me.

@ematipico ematipico merged commit 76167db into next Feb 6, 2025
2 checks passed
@ematipico ematipico deleted the ci/publish-with-changesets branch February 6, 2025 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants