github icon indicating copy to clipboard operation
github copied to clipboard

creating a draft release

Open ahmadnassri opened this issue 4 years ago • 9 comments

is it possible to create a draft only release?

that is, run the whole process, but keep the release labelled as "draft" in github (otherwise referred to as "pre-release" in GitHub's UI and not to be confused with semantic-release's prerelease flag on branches)

I looked through issues and examples in this repo and there was no such example, the only reference to "draft" was in-line and doesn't seem to be specifically flaggable ...

to further distinguish from workflow with prerelease flag, I intend to continue using a single main branch and not looking to implement the workflows as described rather, just make the final github release flagged as "draft" upon publishing.

ahmadnassri avatar Jun 22 '20 23:06 ahmadnassri

To clarify further, are you interested in specifically avoiding additional configuration, or are there details of semantic-release's implementation of prereleases that don't match your goal? Keep in mind that the default configuration enables prereleases for alpha and beta with no extra configuration beyond using those branches.

travi avatar Jun 23 '20 00:06 travi

to state in another lens: while semantic-release can and should be opinionated on the semantic versioning workflow, I believe additional choices on how the "release" (in GitHub's terminology, and GH entity named "release") should be left to the user ...

e.g. draft=true and/or prerelease=true on the Release Entity ...

expectation is be able to use semantic-release with GitHub releases and still tag every tag in GitHub as prerelease / draft if I choose to, regardless of the versioning schema exposes for numbering (-rc, -beta, or none at all)

the real-world-use-case I'm attempting to enable at the moment:

  • one main branch, locked
  • PRs for changes into main branch
  • merged PRs will create a "GitHub Release", flagged as "prerelease=true"
  • CI (GitHub Actions) triggers on release.created with type = prereleased:
    on:
      release:
        types: [prereleased]
    
    CI publishes version to new environment [version].domain.tld
  • human process follows, QA, etc ... when ready, human can change the state of the GitHub Release to uncheck the prerelease flag
  • CI triggers on n release.created with type = released:
    on:
      release:
        types: [released]
    
    CI promotes this version to production

ahmadnassri avatar Jun 23 '20 04:06 ahmadnassri

Yes I totally agree that it should be possible to enable some flag somewhere to have all releases being drafts

KarstenSiemer avatar Dec 22 '20 18:12 KarstenSiemer

@ahmadnassri have you found any decent workaround for this? We'd like to use exactly the same workflow as what you described with draft releases but haven't found a great way to handle it.

If not, I'll try to find the time to make a PR for this project.

CalebAlbers avatar May 12 '21 23:05 CalebAlbers

@CalebAlbers I have not found a solution yet

ahmadnassri avatar May 13 '21 13:05 ahmadnassri

I have the opposite problem, but have found no documentation on the web about it except this thread, so here I am. Our .releaserc file is only creating Draft releases in Github, and I have to go in and manually publish each one as they're created.

https://github.com/edx/frontend-platform/blob/master/.releaserc

Blows my mind, I can't figure out why it won't publish them. The releases publish to npm just fine, and are available to be installed... Github just won't mark them as Published.

davidjoy avatar May 14 '21 15:05 davidjoy

@davidjoy the current semver github plugin puts releases into the draft state while uploading assets. It looks like the releases for the repo you listed have quite a few assets being published (each individual file, rather than a .zip or similar), so I'm wondering if you are hitting the limit of files that can be attached to the release in Github.

This is pure conjecture, but that's the only thing I can think of. The release doesn't get marked as Published until all the assets are uploaded, so a breakdown there could be causing the issue.

CalebAlbers avatar May 14 '21 18:05 CalebAlbers

I was also looking for this option in order to first publish a release candidate (aka draft aka prerelease) that is concluded after the actual prod deployment is done.

This should be quite trivial to introduce, right? How about adding a draft option that defaults to false?

skn-bot avatar May 17 '21 16:05 skn-bot

I am trying to integrate semantic-release with electron-builder and was also looking for this option. My goal is to have semantic-release create a draft release and then electron-builder will upload the artifacts to that release. Once everything is done the release will be published.

This seems like a simple thing to add as most of the code is already there. I would be willing to create a PR for this which implements a draft option like @skn-bot mentioned.

BetaHuhn avatar Jun 06 '21 17:06 BetaHuhn

:tada: This issue has been resolved in version 8.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar May 28 '23 17:05 github-actions[bot]

:tada: This issue has been resolved in version 9.0.0-beta.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar May 29 '23 23:05 github-actions[bot]