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

Release does not consider prerelease tag #817

Open
kaankoken opened this issue May 7, 2024 · 0 comments
Open

Release does not consider prerelease tag #817

kaankoken opened this issue May 7, 2024 · 0 comments

Comments

@kaankoken
Copy link

I have created a mono-repo configuration with proj1 & proj2. I have added a separate command for both release & prerelease. I initially added tags manually for both projects as proj1@v1.0.0 & proj2@v1.0.0. I added some commits and created a release via nx affected -t release --verbose, and everything looks fine.

# git history & tags
06e04e63 KT ◯ proj2@v1.0.0 feat: proj2 initial version 
a3f0f6a4 KT ◯ proj1@v1.0.0 feat: proj1 initial version
7e63ffc3 KT ◯ feat: initial commit

After that, I wanted to try out prerelease. Again, I added some commits and created a prerelease via nx affected -t prerelease --verbose. Until now, everything looks fine.

# git history & tags
50a6e71c KT ◯ proj2@v2.0.0-rc.1 chore(proj2): release version 2.0.0-rc.1   
27a337c5 KT ◯ fix: test with another commit
32a80130 KT ◯ proj2@v2.0.0-rc.0 chore(proj2): release version 2.0.0-rc.0 
3bf74969 KT ◯ fix: proj2 prerelease test 
4546ee6a KT ◯ proj1@v1.1.0-rc.0 chore(proj1): release version 1.1.0-rc.0
b952d741 KT ◯ feat: prerelease test 
06e04e63 KT ◯ proj2@v1.0.0 feat: proj2 initial version
3f0f6a4 KT ◯ proj1@v1.0.0 feat: proj1 initial version                                                                                                                                                                                  7e63ffc3 KT ◯ feat: initial commit

Then, I wanted to turn prereleases to release, and run nx affected -t release --verbose. However, it does not into account the prerelease tags.
What would be the solution for this issue?

# Result
➜ nx affected -t release --verbose --dry-run

 NX   Affected criteria defaulted to --base=master --head=HEAD

 NX   Running target release for 2 projects:

- proj1
- proj2

With additional flags:
  --dry-run=true

> nx run proj1:release --dry-run

[proj1] 🆕 Calculated new version "1.0.1".

> nx run proj2:release --dry-run

[proj2] 🆕 Calculated new version "1.0.1".

 NX   Successfully ran target release for 2 projects

The configurations are below.

// nx.json
    "release": {
      "dependsOn": ["^release"],
      "options": {
        "skipRootChangelog": true,
        "skipProjectChangelog": true,
        "trackDeps": true
      }
    },
    "prerelease": {
      "dependsOn": ["^prerelease"],
      "options": {
        "skipRootChangelog": true,
        "skipProjectChangelog": true,
        "preid": "rc",
        "releaseAs": "prerelease",
        "trackDeps": true
      }
    }
project.json
    "release": {
      "executor": "@jscutlery/semver:version",
      "options": {
        "preset": "angular",
        "tagPrefix": "{projectName}@v"
      }
    },
    "prerelease": {
      "executor": "@jscutlery/semver:version",
      "options": {
        "preset": "angular",
        "tagPrefix": "{projectName}@v"
      }
    }
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