Updating package.json version with incremented build number

kirk.marple's Avatar

kirk.marple

27 Jun, 2017 06:21 PM

I have a node.js project building, and want to auto-increment the version in package.json, based on AppVeyor build number.

Is there a best practice to follow when doing this?

appveyor.yml has:
version: 1.0.{build}

package.json has:
 "version": "1.0.0",

And I'd like to somehow insert the AppVeyor version in package.json during the build.

I'm guessing maybe call 'npm version' with some templated parameter which contains the build version?

Thanks!
Kirk

  1. 1 Posted by Ilya Finkelshte... on 27 Jun, 2017 06:42 PM

    Ilya Finkelshteyn's Avatar

    Hi Kirk,

    Yes, I remember other customers did something like this:

    - npm version %APPVEYOR_BUILD_VERSION% -m 'v%APPVEYOR_BUILD_VERSION%'
    

    Ilya.

  2. 2 Posted by kirk.marple on 27 Jun, 2017 08:50 PM

    kirk.marple's Avatar

    Thanks, that's exactly what I needed.

  3. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:18 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

18 Jun, 2025 08:45 PM
18 Jun, 2025 04:23 PM
13 Jun, 2025 04:36 PM
13 Jun, 2025 04:27 PM
13 Jun, 2025 07:20 AM

 

10 Jun, 2025 01:56 AM
09 Jun, 2025 07:11 PM
04 Jun, 2025 04:08 PM
27 May, 2025 05:48 PM
27 May, 2025 06:37 AM
27 May, 2025 06:31 AM