mikeal / merge-release

Automatically release all merges to master on npm.
Other
471 stars 64 forks source link

Option to update package.json version #9

Closed EmilienLeroy closed 4 years ago

EmilienLeroy commented 4 years ago

Hi, Is it possible to add an option to update the package.json number and commit this change before publish ? An option like this :

    - name: Publish
      uses: mikeal/merge-release@master
      with:
        update_package: true
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
mikeal commented 4 years ago

I had originally written it this way but the problem was that it meant every commit created a subsequent commit to master and it was incredibly noisy.

Once you’re publishing every master commit, it’s not very useful to also have a release commit 🤷‍♂️

mikeal commented 4 years ago

Oh, I should also mention that every release also pushes a new tag, and that tag does have the correct release version in package.json ;)

EmilienLeroy commented 4 years ago

Hi @mikeal,

Thanks you for your answer !

I understand why the package.json isn't automatically update. But in my case, the repo is just a collection of components that i develop into other repositories. I wanted to create an automatic workflow which, when a new version of a component is release, the main collection repo would upgrade with the new component on npm. That's why a option like this would be interesting for my workflow.

Anyway, it's just a little detail and your action work perferctly in my workflow 🙂

vincerubinetti commented 4 years ago

~Hi @mikeal , thank you for the package.~

~What is the intended solution to this, to make sure the repo version, github release/tag version, and npm verion all stay in sync? I notice you say the github tag version does have the correct (automatically incremented) version, and I assume the npm does as well. Does this mean we should just leave the version field in our repo package.json blank, and rely on this github action to put the version field into the github and npm package.jsons?~

Nevermind, I didn't see your response here where you recommend just setting the repo package.json to 0.0.0-dev.