Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prerelease versioning with 2 protected prerelease branches and 1 release branch #1523

Open
L-U-C-K-Y opened this issue Apr 14, 2020 · 0 comments

Comments

@L-U-C-K-Y
Copy link

L-U-C-K-Y commented Apr 14, 2020

Current behavior

Hi all

I have set it semantic release on our GitLab repository with the following setup:

  • production (release to prod environment)
  • beta (prerelease to beta environment)
  • alpha (prerelease to alpha environment)

The desired branching model is:

  1. developers create a feat/xyz branch from alpha (alpha acts as the master branch in that sense).
  2. afterwards, they merge the feat/xyz branch into alpha, test.
  3. merge alpha into beta, test.
  4. beta into production

While most parts of it work, I encounter wrong versions along the process, here an example:

  1. 1.0.0 - initial commit on the production branch
  2. fix/xyz (no release/prerelease)
  3. 1.0.1-alpha.1 - merge fix/xyz into alpha
  4. 1.0.1-beta.1 - merge alpha into beta
  5. 1.0.1 - merge beta into production
  6. feat/xyz2 (no release/prerelease)
  7. 1.1.0-alpha.1 - merge feat/xyz2 into alpha
  8. 1.1.0-beta.1 - merge feat/xyz2 into beta
  9. 1.1.0 - merge beta into production
  10. feat/xyz3 (no release/prerelease)
  11. 1.1.0-alpha.2 - merge feat/xyz3 into alpha --> should be 1.2.0-alpha.1 (or 1.1.1-alpha.1 if it's a fix)

Expected behavior

  • 1.1.0-alpha.2 --> should be 1.2.0-alpha.1

I am open for changes to the branching model, the only requirement is that deployments to alpha, beta and production are possible.

Environment

semantic-release config in package.json:

"release": {
    "branches": [
      "+([0-9])?(.{+([0-9]),x}).x",
      "production",
      {
        "name": "beta",
        "prerelease": true
      },
      {
        "name": "alpha",
        "prerelease": true
      }
    ],
    "plugins": [
      "@semantic-release/commit-analyzer",
      "@semantic-release/release-notes-generator",
      [
        "@semantic-release/gitlab",
        {
          "gitlabUrl": "https://gitlab.com"
        }
      ],
      [
        "@semantic-release/npm",
        {
          "npmPublish": false
        }
      ]
    ],
    "verifyConditions": [
      "@semantic-release/gitlab"
    ],
}

Versions:

    "@semantic-release/commit-analyzer": "^8.0.1",
    "@semantic-release/gitlab": "^6.0.3",
    "@semantic-release/npm": "^7.0.5",
    "@semantic-release/release-notes-generator": "^9.0.1",
    "semantic-release": "^17.0.4",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant