I've been a Java dev for most of career. Currently branching out into frontend space with React. I'm unsure what the best practice is around the workflow in versioning my application from a development build to getting promoted to be a prod-ready build.
I want to follow the semantic versioning pattern of "major.minor.patch". The current workflow in place is as below:
I make and push a change
Jenkins job is triggered and on a successful run of unit tests, the build package is uploaded to Artifactory under the development/ directory and then, deployed to a test environment
After QA is done on the test environment, I want to promote the build from Artifactory development/ to Artifactory production/.
Jenkins job is triggered to deploy to the production environment
How should my application be versioned throughout the above lifecycle from 1 to 4? How can I use "npm version" to automate updating the version?
Let's say the initial version in my package.json is 0.0.1.