josdejong / svelte-jsoneditor

A web-based tool to view, edit, format, repair, query, transform, and validate JSON
https://jsoneditoronline.org
Other
820 stars 108 forks source link

ci: setup Release GitHub Action #240

Closed cloydlau closed 1 year ago

cloydlau commented 1 year ago

Hello,

How about setting up a Release GitHub Action?

Motivation:

       Release Notification:

       

       Without Release GitHub Action:

       

       With Release GitHub Action:

       

josdejong commented 1 year ago

I like the idea of moving the release to a Github Action. It will require some refactoring of the build and release scripts (hopefully they will become simpler :)). I was recently looking into release-please as an alternative for the current scripts to build, test, lint, up the version number, update the changelog, and publish on npm.

On a side note: if your goal is to get a notification on new releases, you can also configure dependabot for example, that will create a PR for you when one of your dependencies has an update, and you get notified about that.

josdejong commented 1 year ago

Just wondering about the PR itself: so it will not publish via Github, but only send out a message or so? I haven't seen this before.

cloydlau commented 1 year ago

the PR itself: Yes it won't publish via GitHub, relax no refactoring will happen :), it won't impact the current release process, it's more like an add-on. I personally write scripts for release process, so I can release my package by simply run cl release. I'm not sure about dependabot. I think creating a PR is to heavy for that, my purpose is to get notified for releases of a specified package, I think email is a good choice.

cloydlau commented 1 year ago

Releases are based on Git tags, which mark a specific point in your repository's history:

image

josdejong commented 1 year ago

👍 I'll merge your PR now, and somewhere this week I expect to publish a few small bug fixes so we can try it out.

Yeah for this project too there are also some scripts in place so you can do npm run release and that's it. I'm using standard-version there though to bump the version numbers, and this is now deprecated. Also, the scripts require to have the right stuff installed locally (node, git, npm), and you have to enter a code for two-factor authentication manually. So, an automated release in the cloud like with Github Actions would be beneficial instead, it would be more robust. But that's for a next step.

cloydlau commented 1 year ago

Perfect. I‘ve received the v0.16.1 release notification email, and the release note works well too:

image

josdejong commented 1 year ago

Yes indeed, https://github.com/josdejong/svelte-jsoneditor/releases/tag/v0.16.1

The release information includes two assets with zip files of the source code. I do not think that is useful (probably only confusing). Do you know whether it is possible to remove those?

cloydlau commented 1 year ago

But actually they're already there, with or without Github Release Action:

image

josdejong commented 1 year ago

Yes I see, I just think it's not very useful (the build output could be useful, but the source not really, is not usable as release). Anyway, not a big deal.

cloydlau commented 1 year ago

I found Github official feedback for this: https://github.com/orgs/community/discussions/6003

josdejong commented 1 year ago

Good find 👍