algolia / shipjs

Take control of what is going to be your next release.
https://community.algolia.com/shipjs/
MIT License
765 stars 30 forks source link

Getting the branch in prepare for multiple releases #958

Open vinayakkulkarni opened 3 years ago

vinayakkulkarni commented 3 years ago

Is your feature request related to a problem? Please describe. What I'm trying to achieve is setting the next and latest tags based on branches. I want ship.js to trigger a new latest release when on branch main & next release when on branch next.

Describe the solution you'd like Ability to modify the publishCommand by using git branches

Describe alternatives you've considered N/A.

Additional context N/A.

eunjae-lee commented 3 years ago

Hi @vinayakkulkarni Do you think publishCommand works for you?

({ isYarn, tag, defaultCommand, dir }) => defaultCommand

It may not have all the necessary information for you, but if you maintain main and next branches and have different major versions for them, then you could read package.json and according to decide which tag to publish it with. Does it make sense to you?

And asynchronous form of publishCommand function is not supported yet, so you'd better use something like fs.readFileSync() for it.

Let me know how it goes and if you have any question.