Skip to content

fix: version determination of 4 branch GitFlow repo #789

@ZionStage

Description

@ZionStage

Hello everyone (and a happy new year to all),

I have been using python-semantic-release for 2 months now, and I still encounter problems setting it up for my current work flow.

I have a python package with 3 main branches (main, beta and development) and some feature branches (feat-*). I need to have a dependable versioning system on all these branches in order to generate a front end client in the CI. My workflow is as is :

  • For a new feature, create a feature branch from development
  • Iterate on this feature branch until everything works
  • Merge on development
  • [Optional] repeat with as many features as needed
  • Merging development into beta
  • When ready for production, merging beta into main
  • Merging main into beta and beta into development

I have the following conf file :

[tool.semantic_release]
version_toml = [
    "pyproject.toml:project.version",
]
commit_message = "Bump to {version} [skip ci]\n\nAutomatically generated by python-semantic-release"

[tool.semantic_release.branches.main]
match = "main"

[tool.semantic_release.branches.beta]
match = "beta"
prerelease = true
prerelease_token = "beta"

[tool.semantic_release.branches.development]
match = "development"
prerelease = true
prerelease_token = "alpha"

[tool.semantic_release.branches.features]
match = "^feat-.*$"
prerelease = true
prerelease_token = "dev"

When creating a feature branch the versioning works well, however as soon as I merge into development and merge development into beta I run into some versioning problems.
Sometimes even if I'm on beta the output version is tagged alpha, sometimes the output version does not have a pre-release token.
Obviously, there's something wrong with my configuration for my workflow, but I can't seem to pinpoint what it is even after reading the whole docs. So here are my questions :

  • Can python-semantic-release work with the workflow I described ?
  • If so, what am I missing ?

Thank you !

Metadata

Metadata

Assignees

Labels

bugSomething isn't working properly

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions