Skip to content

Gitlab flow help #1439

@mdelmans

Description

@mdelmans

Question

I really like the tool but I struggle to make it work for my case.

I have a Gitlab flow setup with main, staging and production branches.

From time-to-time main is merged into staging and staging is merged to production.

I run semantic-release on all three branches

My flow is:

  1. I create a couple of "feat: ..." commits in main. They are correctly tagged as 1.0.0-dev.1 and 1.0.0-dev.2
  2. I then merge main to staging. The merge commit is correctly tagged as 1.0.0-rc.1
  3. I merge staging to production. The merge commit in production is correctly tagged as 1.0.0
  4. I create a new "feat: ..." commit in main. It receives a 1.0.0-dev.3 tag instead of 1.1.0-dev.1 tag

Am I doing something wrong or this case is not supported and there is nothing I can do to make it work correctly?

Would appreciate any insights. Thanks!

Configuration

Semantic Release Configuration
[semantic_release.branches.main]
match = "main"
prerelease_token = "dev"
prerelease = true

[semantic_release.branches.staging]
match = "staging"
prerelease_token = "rc"
prerelease = true

[semantic_release.branches.production]
match = "production"
prerelease = false

Additional context

I run semantic-release -c releaserc.toml -vv version --no-commit --no-changelog --no-vcs-release on main

I run semantic-release -c releaserc.toml -vv version --no-commit --no-changelog on staging and production

I do merges with --no-ff

git log --oneline --decorate --graph --all -n 50
* b04fbea (tag: v1.0.0-dev.3, origin/main, origin/HEAD, main) feat: feature 3
| *   d155f0f (HEAD -> production, tag: v1.0.0, origin/production) Merge branch 'staging' into production
| |\
| | *   4ecd51f (tag: v1.0.0-rc.1, origin/staging, staging) Merge branch 'main' into staging
| | |\
| |_|/
|/| |
* | | 19ab5f9 (tag: v1.0.0-dev.2) feat: add feature 2
* | | e3e60be (tag: v1.0.0-dev.1) feat: feature 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    questiontriagewaiting for initial maintainer review

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions