Single source of truth for version - #52
Conversation
these are bound to get out-of-sync at some point, and they are not required because we don't publish an npm package https://docs.npmjs.com/cli/v10/configuring-npm/package-json?v=true#version
bringing in docker image support
|
Hi @dennisvang! I think that, when running |
Yes, the release process uses git tags for versioning, same as for the fdp repo, etc. |
The .git dir is only needed to get a version description based on git tags in the build stage. The .git dir is not copied to the final image.
@mihailefter Yes,good point. That was true for the I just removed
Yes, git is available in the image used for the dockerfile build stage. |
|
@mihailefter I also updated the PR description. |
|
@mihailefter do you think this is ready to be merged? |
mihailefter
left a comment
There was a problem hiding this comment.
Hi @dennisvang! This can be merged, indeed.
This creates a version string based on
gittags during the build phase.The version string is based on the latest tag and is always in git's long format, e.g.
v1.2.3-0-gfc7760fif the latest tag isv1.2.3.If the repo has no git tags (yet), we fall back on the abbreviated commit hash, e.g.
fc7760f.nameandversionfrompackage.jsongitDescribeVersionhelpervite.config.tsto get the app version fromgitduring the Vite build phaseNote that
gitDescribeVersionrunsgit describe, synchronously, using child_process.spawnSync, and fails intentionally if the version string is empty.fixes #47