muratgozel / node-calver

Calendar based software versioning library as node.js module and with cli support. 📅
MIT License
28 stars 5 forks source link

Missing `post` identifier #25

Open miigotu opened 7 months ago

miigotu commented 7 months ago

I currently have a convoluted way of getting my calendar versioning handled in most of my projects.

First non-(dev,beta,rc) release of the day is tagged/versioned with the date: yyyy.mm.dd If a second full release is made, for say a hotfix, a suffix is added -1 for example, and is incremented for each subsequent release. This post/hotfix identifier is completely absent if there is only one public release that day. The next day resets to yyyy.mm.dd

On pypi/poetry, when I build and publish with a version like 2024.2.1-1 creates a version on pypi 2024.2.1.post1 with no manual input required.

These are uploaded to pypi and not treated as pre-releases.

I do not have dev,rc,beta builds uploading yet, but I want to get pre-releases up so my users can test it before it goes out wide.

https://pypi.org/project/sickchill/#history

It would be awesome if just calling

with today = 2024.2.1 calver.inc(format, '', 'calendar.post') returned '2024.2.1', calver.inc(format, '2023.2.1', 'calendar.post') (previous date) returned '2024.2.1', calver.inc(format, '2024.2.1', 'calendar.post') returned '2024.2.1.post1', calver.inc(format, '2024.2.1.post1', 'calendar.post') returned '2024.2.1.post2

and possibly add a nulpost (or something of that nature) modifier that would accept and create a post level without modifier words:

calver.inc(format, '', 'calendar.nulpost') returned '2024.2.1', calver.inc(format, '2023.2.1', 'calendar.nulpost') (previous date) returned '2024.2.1', calver.inc(format, '2024.2.1', 'calendar.nulpost') returned '2024.2.1-1', calver.inc(format, '2024.2.1-1', 'calendar.nulpost') returned '2024.2.1-2

Also, note my nulpost has a - separator and pypi converts it to . = maybe a parameter for modifier-level separator?

I'm interested in writing a github action to make this simple for python users to use, and keep both a release branch and a dev/rc branch uploaded to pypi with pre-releases. So any help getting this library to work in the odd way I am trying to make it fit me lmk lol. Thanks.

muratgozel commented 3 months ago

hey @miigotu would you mind if i ask you to take a look at the most recent major version of the library? i have been thinking about the concept and would love to hear your opinions too.

miigotu commented 3 months ago

hey @miigotu would you mind if i ask you to take a look at the most recent major version of the library? i have been thinking about the concept and would love to hear your opinions too.

I'll give it a run through when I have spare time to mess with my GitHub stuff, been a bit busy. I'll get back to you.