Coder Social home page Coder Social logo

Comments (14)

TheUnderScorer avatar TheUnderScorer commented on July 25, 2024 1

Hey!

I'm not sure if that is the intended setup for the NX workspaces. I think that usually, the directory name should match the project name.

I'll see if I can tackle this in the next release, although it seems like a low-priority issue for now.

from nx-semantic-release.

doomietrue avatar doomietrue commented on July 25, 2024

Hi,

I am experiencing the same issue with npmPublish:false but seems the names are ok. My .nxrelease.json configuration file is set up as follows:

{
  "changelog": true,
  "npm": true,
  "github": false,
  "repositoryUrl": "ssh://[email protected]:7999/monorepo.git",
  "outputPath" : "${WORKSPACE_DIR}/dist",
  "buildTarget": "build",
  "branches": ["master"]
}

in .npmrc registry set to company npm registry.

I run it with npx nx affected --base=master --target=semantic-release --parallel=false

I have 2 packages in nx monorepo and the following target

"semantic-release": {
      "executor": "@theunderscorer/nx-semantic-release:semantic-release"
    }

However, when I run the release process, the package is not being published to the npm registry. Instead, I see the following log message:

[semantic-release] [@semantic-release/npm] › ℹ  Skip publishing to npm registry as npmPublish is false

I have tried running nx-semantic-release in debug mode, but I didn't find any relevant errors or warnings related to publishing the package.

Could you please help me understand why the package is not being published, even though the npm option is set to true in my configuration? Is there any additional configuration or steps that I need to follow to ensure the package is published correctly?

Edit:
Disregard my comment, outputPath was wrong.
My apologies.

from nx-semantic-release.

daniel-clover avatar daniel-clover commented on July 25, 2024

I have a similar issue, I'm getting:
Skip publishing to npm registry as npmPublish is [secure]

my .nxrelease.jon

{ "changelog": true, "npm": true, "github": false, "repositoryUrl": "https://github.XXXXXX.com/clover/web-lib-sprout-design-system", "branches": [ "master" ] }

I've searched for this error, but came up with nothing.

Do you have any suggestions on what I could look for?

from nx-semantic-release.

daniel-clover avatar daniel-clover commented on July 25, 2024

from nx-semantic-release.

ruscon avatar ruscon commented on July 25, 2024

@daniel-clover

In general, you can avoid running this command: npx nx run-many --all --target build

You just need to fix your .nxreleaserc.json
change from

"buildTarget": "build",

to

"buildTarget": "${PROJECT_NAME}:build",

Then the build target will be called automatically

example of my .nxreleaserc.json

{
  "repositoryUrl": "[email protected]:XXX/YYY.git",
  "npm": true,
  "github": true,
  "changelog": false,
  "outputPath": "dist/${PROJECT_DIR}",
  "buildTarget": "${PROJECT_NAME}:build",
  "tagFormat": "${PROJECT_NAME}-v${VERSION}",
  "commitMessage": "chore(release): ${nextRelease.gitTag} [skip ci]\n\n${nextRelease.notes}",
  "branches": [
    "main"
  ]
}

from nx-semantic-release.

daniel-clover avatar daniel-clover commented on July 25, 2024

from nx-semantic-release.

ruscon avatar ruscon commented on July 25, 2024

@daniel-clover I'm not a developer of this repo :D
I just ran into the same problem :)

from nx-semantic-release.

ruscon avatar ruscon commented on July 25, 2024

@daniel-clover I didn't see Skip publishing to npm registry as npmPublish is [secure] in my logs. So maybe this is something else on your side.

In each package.json I have

  "publishConfig": {
    "registry": "https://npm.pkg.github.com",
    "access": "restricted"
  },

from nx-semantic-release.

daniel-clover avatar daniel-clover commented on July 25, 2024

from nx-semantic-release.

ruscon avatar ruscon commented on July 25, 2024

@daniel-clover ps.
fix

"commitMessage": "chore(release): ${nextRelease.gitTag} [skip ci]\\n\\n${nextRelease.notes}",

to

"commitMessage": "chore(release): ${nextRelease.gitTag} [skip ci]\n\n${nextRelease.notes}",

from nx-semantic-release.

daniel-clover avatar daniel-clover commented on July 25, 2024

from nx-semantic-release.

ruscon avatar ruscon commented on July 25, 2024

@daniel-clover try to copy options from .nxreleaserc.json to concrete project.json

something like this

    "semantic-release": {
      "executor": "@theunderscorer/nx-semantic-release:semantic-release"
      "options": {
        "github": true,
        "changelog": false,
        "npm": true,
        "buildTarget": "nx-js:build",
        "outputPath": "dist/libs/nx/js",
        "tagFormat": "${PROJECT_NAME}-v${VERSION}"
      }
    }

change nx-js to your project name everywhere

from nx-semantic-release.

erwinokken avatar erwinokken commented on July 25, 2024

@daniel-clover try to copy options from .nxreleaserc.json to concrete project.json

something like this

    "semantic-release": {
      "executor": "@theunderscorer/nx-semantic-release:semantic-release"
      "options": {
        "github": true,
        "changelog": false,
        "npm": true,
        "buildTarget": "nx-js:build",
        "outputPath": "dist/libs/nx/js",
        "tagFormat": "${PROJECT_NAME}-v${VERSION}"
      }
    }

change nx-js to your project name everywhere

I can confirm that this works.

Before I had this configuration in the global .nxreleaserc.json:

"buildTarget": "${PROJECT_NAME}:build",
"outputPath": "dist/${PROJECT_DIR}",

I updated this to use the specific project.json files.

"options": {
	"buildTarget": "projectname:build",
	"outputPath": "dist/libs/projectname"
}

The error is misleading and an explicit warning/errorcould fix this.

from nx-semantic-release.

github-actions avatar github-actions commented on July 25, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 3 days.

from nx-semantic-release.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.