-
Notifications
You must be signed in to change notification settings - Fork 3
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
Update Build to incorporate version number in Rust and Node.js Packages #40
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better approach than the one I took. I've added PR to development of #11
tools/src/version.ts
Outdated
await writeTomlManifest(packageTargetPath, version); | ||
} | ||
else { | ||
logger.fatal(`Unsupported package target: '${packageTargetPath}'.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I was debugging for Windows, this print was not displaying. However, when I changed it to logger.info(), it started working. I also tried giving nx the --output-style=static flag, but it didn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, OK. Perhaps the default level doesn't include fatal. I'll try it with logger.error()
. Also, perhaps it should be more fatal and the build should fail. I'll take a look at whether you can inform Nx that the build should fail via the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this so that it now reports the failure to Nx which then fails the build.
This PR implements #11 by adding a custom Nx Executor that will first compute a SemVer compatible version number; and then use it to update the appropriate
'package.json'
and'Cargo.toml'
files.The version number is based on the major and minor values defined in a new
'version.json'
file that is present in the root of the repository. This file will be used to control the product version that we require a build for, while the Nx Executor will suffix the version with either: a) the commit height for releasable branches, or b) the current commit id for all other branches.Updating the version numbers is an explicit task. It is run via
npm run set-version
(which should be run before thebuild
orpackage
script variants). I would expect this to be typical in a CI context.