unjs / changelogen

💅 Beautiful Changelogs using Conventional Commits
MIT License
917 stars 46 forks source link

`changelogen release-ci` to auto release (`pkg.pr.new`) #215

Open pi0 opened 1 month ago

pi0 commented 1 month ago

Describe the feature

We can introduce changelogen release-ci that triggers release on each CI run.

pkg.pr.new could be first provider but i am thinking that we design internal impl to be provider agnostic. (if defined as a direct fetch specification that would be perfect, we can use npm pack + POST)

/cc @Aslemammad if you had time before me to pick on this, i would love to have it 🙏🏼

Additional information

Aslemammad commented 1 month ago

I love this, what do you think about changelogen preview as a command?

And under the hood, we just run pkg.pr.new publish and pass the arguments there.

pi0 commented 1 month ago

I love this, what do you think about changelogen preview as a command?

Love preview 💯

And under the hood, we just run pkg.pr.new publish and pass the arguments there.

Do you think maybe it would be hard to use a fetch call to pkg.pr.new + npm pack? 🙏🏼

Aslemammad commented 1 month ago

Do you think maybe it would be hard to use a fetch call to pkg.pr.new + npm pack? 🙏🏼

It's doable, but yea, it's hard, since the command line does so much and only small part of it is the fetch call!

pi0 commented 4 weeks ago

@Aslemammad Considering all the limitations, still if you can give me an overall idea about how we can directly upload a tarball to pkg.pr.new registry API I would love to make this happen 🙏🏼

(the long-term goal is to make changelogen independent from registry CLIs. I am also working to find a solution to removing the npm CLI dependency as well from changelogen that's why it is important, even if means less features at first)

Aslemammad commented 4 weeks ago

Ok, I can do it by the next two weeks hopefully if you want! I'd be happy to.

But the most important thing is generating the hash for the workflow environment!

And if that hash is the correct hash that was also generated asymmetrically in the server, then pkg.pr.new would allow you to publish.

https://github.com/stackblitz-labs/pkg.pr.new/blob/main/packages/cli/index.ts#L364-L376

See sb-key.

Let me know what do you think.

Aslemammad commented 2 weeks ago

I have an idea, what if I make a export pkg.pr.new/utils that gets directories/templates and publishes them? In such case, we'd need to install the pkg.pr.new dependency (an optional dep?). And then dynamic import it.

Would that still be allowed? What do you think?

It'd make the job way easier.

Aslemammad commented 2 weeks ago

I'll send a pkg.pr.new for preview on changelogen so I can try experimenting!

pi0 commented 2 weeks ago

Thanks for initiating work on this dear @Aslemammad. Ideally, if it would be possible to avoid direct dependency (but depending on the API contract only) it would be best and future-proof.

(feel free to DM me in discord if you like to chat)