Automating Releases and Publishing with Nx Release

Automating Releases and Publishing with Nx Release

I have been using Nx to start all my projects for a long time—from services and applications to a set of different libraries. Nx provides many convenient and high-level tools for efficient monorepo management. However, one problem has been haunting me for a long time—releasing and publishing libraries. Each time, I had to devise and try to implement another workaround that excluded the errors from the previous one. However, each new solution usually had its own drawbacks.

But Nx 17.0 allowed us to release and publish packages out of the box! Of course, Nx Release has drawbacks, but at least it's an out-of-the-box solution, and (spoiler) it works great on GitHub. Today, we will look at setting up Nx Release using the example of the young micro-frontend framework Mexo.

Setting up Nx

The first step is to add Nx Release settings to nx.json: