p4lang / p4analyzer

A Language Server Protocol (LSP) compliant analyzer for the P4 language
Apache License 2.0
19 stars 3 forks source link

Update Build to incorporate version number in Rust and Node.js Packages #40

Closed timjroberts closed 1 year ago

timjroberts commented 1 year ago

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 the build or package script variants). I would expect this to be typical in a CI context.