Search code examples
semantic-release

Apply semantic to custom git flows


I've found semantic-release and it looks very useful. But I'm wondering how to customize it to fit our workflow:

  • no dev branch, just a master and feature/fix/chore branches.
  • latest release (github with relevant git tag) correspond to version pushed to production.
  • Draft release correspond to version pushed to staging.

This is a private industry project, so we cannot go completely lean and must respect internal design guidelines including batching PRs on staging before releasing on production.

I can add a dev branch, and push staging from dev, then production from master after merging dev to master. But I'd like my github draft release to be updated as soon as a pull request is merged back into dev (draft release that would become the latest release once dev is merged into master).

Is that somehow possible ? I recently installed the semantic pull request github app, and started using conventional commit conventions, but I'm unclear about how to use release-notes-generator on its own, or whether it handles the github draft release mode.


Solution

  • But I'm wondering how to customize it to fit our workflow: * no dev branch, just a master and feature/fix/chore branches. * latest release (github with relevant git tag) correspond to version pushed to production. * Draft release correspond to version pushed to staging.

    It only analyze the commit on the branch that you configure (by default master). It doesn't matter how the commit get there, you can merge them in any branch you want before they reach master. When they get to master and semantic-release run it will analyze the commits on master and make a release if necessary.

    semantic-release doesn't support draft/pre-release yet (See https://github.com/semantic-release/semantic-release/issues/563).

    I recently installed the semantic pull request github app

    What you are referring to? There is no semantic-release GitHub app at that point, even though it's planned to have one at some point (https://github.com/semantic-release/semantic-release/issues/585).

    but I'm unclear about how to use release-notes-generator on its own, or whether it handles the github draft release mode

    release-notes-generator is responsible for generating the release note and doesn't interact with GitHub. The @semantic-release/github is responsible for creating the release on GitHub.