Skip to content

Use release branches #28

@codcod

Description

@codcod

Use a release branch that aggregates multiple merged feature PRs, then run your semantic-versioner once on that branch to produce a single bump based on the combined commits. Use conventional commit markers / labels so the versioner sees feature vs. fix vs. breaking-change intent for all included PRs.

How to do it (practical steps)

  1. Enforce conventional commits or PR labels (feat/, fix/, BREAKING CHANGE, or custom labels like include-in-release).
  2. Merge feature PRs into a release branch (e.g., release/x.y or main) OR create a “release PR” that gathers selected feature PRs.
  3. Run semantic-version once on that branch/PR (not per-feature). Configure the action to evaluate the entire set of commits, not each commit individually. Key settings:
    • bump_each_commit: false (don’t increment per commit)
    • search_commit_body: true (look for patterns in PR bodies)
    • use commit/PR labels or conventional commit prefixes to mark major/minor/patch
  4. Produce changelog from the combined commits/PRs and create the single release tag (vX.Y.Z) and release notes.
  5. Build artifacts from that tagged commit and publish.

CI config hints

  • Use a manual release trigger (workflow_dispatch) or run only on merge of the release branch so the pipeline runs once for the aggregate, not per-feature.

Example semantic-version step (paulhatch action)

- name: Determine version
  uses: paulhatch/semantic-version@v5.4.0
  with:
    tag_prefix: "v"
    major_pattern: "(MAJOR)|BREAKING CHANGE|!:"
    minor_pattern: "(MINOR)|^feat:"
    change_path: "src"
    search_commit_body: true
    bump_each_commit: false

Example workflow pattern (concept)

  • Developers merge feature PRs into a release branch or create a release PR that merges multiple features.
  • Trigger semantic-version once on that branch (or via workflow_dispatch).
  • Update Cargo.toml, create tag vX.Y.Z, generate changelog, build & publish artifacts.

Why this works

  • Calculating version from the aggregate commit set ensures the bump reflects the most significant change among all included PRs (major > minor > patch).
  • Prevents per-PR tiny releases and ensures a single coherent release containing multiple features.

Keep it minimal

  • Don’t run semantic-version per feature. Run it once per release branch / manual dispatch, and use bump_each_commit=false so the tool computes the correct single bump for the whole release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorA code change (src or test) that neither fixes a bug nor adds a feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions