p4lang / p4analyzer

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

Version control added to build #39

Closed AndrewF001 closed 1 year ago

AndrewF001 commented 1 year ago

For issue #11

Whenever a version update happens, all that needs to change is the new git_commit.js file version number.

Instead of using number of commits to head git rev-list --count HEAD, I chose first 8 characters of commit (Linux builds does the same). If it was number of commits from HEAD, I thought there might be duplicates if we do a commit fixup or reverts of main.

timjroberts commented 1 year ago

I think this only versions the TypeScript packages. We have to define a version for both the built '.vsix' package and the native 'p4analyzer' binary.

Nx allows you to build custom executors that allow you to define build utilities. This may be the best approach.

AndrewF001 commented 1 year ago

The .vsix file name does get updated with the file version automatically from npx. You can see it in action with the artifact from the CI pipeline.

I will work on the prebuild script for the binaries names

AndrewF001 commented 1 year ago

Redundant as #40 is a better approach