release-script icon indicating copy to clipboard operation
release-script copied to clipboard

Please add option to only commit, no release and release only

Open DutchmanNL opened this issue 5 years ago • 13 comments

I see situation a alpha. should only. be own git, so I would like to choose if my run should only end on git, or also on NPM

In addition, if the version is already. on git but not NPM, an option to only "release" would be great too

DutchmanNL avatar Apr 24 '20 07:04 DutchmanNL

So basically you want to skip the version bump? For the automatic release it would still require tagging the current commit, so there must not already be a tag with that version.

AlCalzone avatar Apr 24 '20 08:04 AlCalzone

Or do you still want to bump the version but skip the npm release? In the current workflow, all git tags are released on npm. Alpha version should have a prerelease suffix like v1.2.3-alpha.0.

The build action would release those too: https://github.com/ioBroker/create-adapter/blob/master/templates/_github/workflows/test-and-release.yml.ts#L28-L29 so it would be up to you to decide if you want these two lines active or not.

AlCalzone avatar Apr 24 '20 08:04 AlCalzone

hmm than it can make sense to have an alpha option ? alpha meaning : only git push with tag, patch/minor/major than additional to publish npm

if you use minor as example it will run all, if I use alpha its only using the routines up to git. If I use patch/minor/major after that it sees an version on git but not NPM and handles thee publish

i likes to test alpha before releasing on NPM as on NPM al beta teste see the new version which leads in indeed issues

DutchmanNL avatar Apr 24 '20 09:04 DutchmanNL

Like I said, comment out the two lines in your Github Actions workflow so the release step doesn't trigger. Then you can use the pre-versions to push the release on github without releasing on npm:

  • npm run release preminor alpha - Bumps e.g. 1.0.0 to 1.1.0-alpha.0
  • npm run release premajor beta - Bumps e.g. 1.0.0 to 2.0.0-beta.0
  • npm run release prerelease - Bumps a prerelease version, e.g. 1.1.0-alpha.0 to 1.1.0-alpha.1 and so on.

AlCalzone avatar Apr 24 '20 10:04 AlCalzone

I think this issue should rather be adding good documentation instead of a new feature :) Well, maybe merging multiple prerelease changelogs into a final one.

AlCalzone avatar Apr 24 '20 10:04 AlCalzone

I think this issue should rather be adding good documentation instead of a new feature :)

agree, as I explained the used case is having an alpha not on latest repo so based on documentation of way of handling the Flow this could be accomplished

DutchmanNL avatar Apr 24 '20 11:04 DutchmanNL

i fixed this by basically only having the release script running when I publish anything to the main branch, I would suggest to add this as a best practice ?

https://github.com/DrozmotiX/ioBroker.esphome/blob/main/.github/workflows/test-and-release.yml#L8

DutchmanNL avatar Mar 23 '21 16:03 DutchmanNL

I don't see how that solves the problem though. If you push a tag, the action will run for that tag too. And by limiting the workflow to the main branch, your tests won't run for the branch.

If you want to selectively disable parts of the release, it needs to be checked in the steps of the release job: https://github.com/DrozmotiX/ioBroker.esphome/blob/main/.github/workflows/test-and-release.yml#L103

AlCalzone avatar Mar 23 '21 16:03 AlCalzone

If you want to selectively disable parts of the release, it needs to be checked in the steps of the release job:

agree, good point.... anyway, I guess he issue can be closed by adding this to the documentation or having his issue as explanation ?

DutchmanNL avatar Mar 23 '21 17:03 DutchmanNL

We could add the explanation as comments into the template.

AlCalzone avatar Mar 23 '21 18:03 AlCalzone

@AlCalzone To which two lines in the template are you referring to? The template seems to have changed since you wrote your comment. Which lines should I comment out if I do not want to have pre-versions published on NPM but only patch/minor/major?

pdbjjens avatar Jul 14 '23 14:07 pdbjjens

@pdbjjens The one near the start of the workflow file that has a comment "pre-releases" above it:

      # pre-releases
      - "v[0-9]+.[0-9]+.[0-9]+-**"

AlCalzone avatar Jul 14 '23 18:07 AlCalzone

@AlCalzone Thanks a lot for the quick reply. I'll give it a try.

pdbjjens avatar Jul 14 '23 20:07 pdbjjens