You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to manage a monorepo and release packages with nx release.
While it's working very well locally (on my machine), I can't easily manage the version/publish in CI/CD.
There is no documentation in the recipes (Recipes > nx release) and my attempts are not so great.
and I have this github workflow to version and publish
if [ ${{ github.ref_name }} = "main" ]; then
echo "This is the main branch."
pnpm nx release --first-release --skip-publish
pnpm nx release publish --output-style=stream
else
echo "This is not the main branch."
pnpm nx release --skip-publish
pnpm nx release publish --tag ${{ github.ref_name }} --output-style=stream
If there is nothing to version, nx release publish will try to publish and I get an error -> seems right
If there are changes, a new version is created and publishing is working correctly -> seems right too
But I have some issues so:
How can I version in CI/CD following conventional commits and publish ONLY IF there is a change ?
How release/prerelease should be done with nx release in CI/CD ?
For example:
I need release on the main branch and prerelease on the develop branch
If I merge develop into main, nx release doesn't detect changes
my-lib 🔍 Reading data for package "@ccreusat/my-lib" from packages/my-lib/dist/package.json
my-lib 📄 Using the current version 0.3.2-develop.6 already resolved from git tag "0.3.2-develop.6".
my-lib 🚫 Skipping versioning "@ccreusat/my-lib" as no changes were detected.
Expected Behavior
What I am expecting is:
If there is nothing to version, nx release publish should not be triggered
I can version with nx release version --specifier prerelease but for some reason, git tags are not pushed to remote.
If there are changes, a new version is created and publishing is working correctly
If I'm doing a prerelease on the develop branch, when I'm merging into main, CI/CD should trigger a version and a publish with a stable/latest version
We should have something like semantic release to configure in nx.json (or maybe there is already a solution)
No changes are detected on the main branch, nx will find tag coming from develop
my-lib 🔍 Reading data for package "@ccreusat/my-lib" from packages/my-lib/dist/package.json
my-lib 📄 Using the current version 0.3.2-develop.6 already resolved from git tag "0.3.2-develop.6".
my-lib 🚫 Skipping versioning "@ccreusat/my-lib" as no changes were detected.
Add a new component in one of the react packages
Commit changes with fix | feat type
Use nx release --dry-run on the main branch
Detect changes with conventional commit but will tag 0.3.2-develop.7 instead of 0.3.2
Completely aligned with it. NX Release doesn't work if having for example a staging branch for prerelease and a production branch for release. No changes are detected when merging one into another and it's blocking us migrating from semantic-release @jaysoo, do you think it will be possible to have it someday ?
Any feedback on this as I want to migrate to nx release from @jscutlery/semver:version but unfortunately need to prerelease per feature branch and production release for master/main branch
Completely agree here. Versioning in nx and @jscutlery/semver both base versioning and releases from tags. Tags are not a dependable source of versioning, because they can change easily. It also makes a next/main versioning process impossible, and least in my understanding.
Current Behavior
I'm trying to manage a monorepo and release packages with
nx release
.While it's working very well locally (on my machine), I can't easily manage the version/publish in CI/CD.
There is no documentation in the recipes (Recipes > nx release) and my attempts are not so great.
My current
nx.json
config for release is:and I have this github workflow to version and publish
nx release publish
will try to publish and I get an error -> seems rightBut I have some issues so:
nx release
in CI/CD ?For example:
main
branch and prerelease on thedevelop
branchnx release
doesn't detect changesExpected Behavior
What I am expecting is:
nx release publish
should not be triggerednx release version --specifier prerelease
but for some reason, git tags are not pushed to remote.develop
branch, when I'm merging intomain
, CI/CD should trigger a version and a publish with a stable/latest versionWe should have something like
semantic release
to configure innx.json
(or maybe there is already a solution)GitHub Repo
https://github.com/ccreusat/ccreusat-package-based
Steps to Reproduce
nx release --dry-run
on the main branchdevelop
nx release --dry-run
on the main branch0.3.2-develop.7
instead of0.3.2
Nx Report
Failure Logs
No response
Package Manager Version
[email protected]
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: