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

Nx release followed by publish not using generated version #30171

Open
1 of 4 tasks
ash-burns opened this issue Feb 25, 2025 · 0 comments
Open
1 of 4 tasks

Nx release followed by publish not using generated version #30171

ash-burns opened this issue Feb 25, 2025 · 0 comments

Comments

@ash-burns
Copy link

ash-burns commented Feb 25, 2025

Current Behavior

I have a workflow which takes a comma separated list of projects and a version specifier to manually release libraries, using the following nx commands:

- name: Manually publish packages
  run: |
    pnpm exec nx release --projects ${{ github.event.inputs.projects }} --specifier ${{ github.event.inputs.specifier }} --skip-publish
    pnpm exec nx release publish --projects ${{ github.event.inputs.projects }} --output-style=stream

However I get the following output when I provide "styles", which doesn’t identify it has generated a new version to release. Running it again will recognise "1.6.0" hasn't been published yet and continues to publish it to a private npm repo.

NX   Your filter "styles" matched the following projects:

- styles

 NX   Running release version for project: styles

styles 🔍 Reading data for package "@(repo)/styles" from libs/styles/package.json
styles 📄 Resolved the current version as 1.5.0 from git tag "[email protected]".
styles 📄 Using the provided version specifier "minor".
styles ✍️  New version 1.6.0 written to libs/styles/package.json

UPDATE libs/styles/package.json

    "name": "@(repo)/styles",
-   "version": "1.5.0",
+   "version": "1.6.0",
    "peerDependencies": {

 NX   Staging changed files with git

 NX   Committing changes with git

 NX   Tagging commit with git

 NX   Pushing to git remote "origin"

 NX   Creating GitHub Release

CREATE https://github.com/(repo)/common-ui/releases/tag/[email protected]

+ ## 1.6.0 (2025-02-25)
+
+ This was a version bump only for styles to align it with other projects, there were no code changes.

 NX   Skipped publishing packages.

 NX   Your filter "styles" matched the following projects:

- styles

 NX   Running target nx-release-publish for project styles:

- styles

> nx run styles:nx-release-publish

styles: Skipped package "@(repo)/styles" from project "styles" because v1.5.0 already exists in https://npm.pkg.github.com/ with tag "latest"

 NX   Successfully ran target nx-release-publish for project styles

Expected Behavior

I expect the command "nx run styles:nx-release-publish" to identify that v1.6.0 has just been released and to publish it correctly.

GitHub Repo

No response

Steps to Reproduce

  1. Execute a Github Action with the following step.
- name: Manually publish packages
  run: |
    pnpm exec nx release --projects ${{ github.event.inputs.projects }} --specifier ${{ github.event.inputs.specifier }} --skip-publish
    pnpm exec nx release publish --projects ${{ github.event.inputs.projects }} --output-style=stream

Nx Report

Node           : 22.14.0
OS             : win32-x64
Native Target  : x86_64-windows
pnpm           : 10.4.1

nx (global)            : 20.4.1
nx                     : 20.4.6
@nx/js                 : 20.4.6
@nx/jest               : 20.4.6
@nx/eslint             : 20.4.6
@nx/workspace          : 20.4.6
@nx/angular            : 20.4.6
@nx/devkit             : 20.4.5
@nx/eslint-plugin      : 20.4.6
@nx/module-federation  : 20.4.5
@nx/web                : 20.4.6
@nx/webpack            : 20.4.5
typescript             : 5.7.3
---------------------------------------
Community plugins:
angular-eslint : 19.1.0
---------------------------------------

Failure Logs

Package Manager Version

pnpm 10.4.1

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

My nx.json config:

"release": {
    "projects": ["libs/*"],
    "projectsRelationship": "independent",
    "version": {
      "conventionalCommits": true,
      "generatorOptions": {
        "fallbackCurrentVersionResolver": "disk",
        "updateDependents": "auto",
        "skipLockFileUpdate": false
      }
    },
    "changelog": {
      "projectChangelogs": {
        "renderOptions": {
          "authors": false
        },
        "createRelease": "github",
        "file": false
      },
      "automaticFromRef": true
    }
  },
  "targetDefaults": {
    "nx-release-publish": {
      "dependsOn": ["^build"],
      "options": {
        "packageRoot": "dist/libs/{projectName}"
      }
    },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant