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

pkgRoot property not working #601

Open
paulorenanmelo opened this issue Apr 6, 2023 · 1 comment
Open

pkgRoot property not working #601

paulorenanmelo opened this issue Apr 6, 2023 · 1 comment

Comments

@paulorenanmelo
Copy link

paulorenanmelo commented Apr 6, 2023

Hi, I'm having an error using Semantic Release, which seems to indicate that the pkgRoot variable is not being picked up:

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /builds/squint-nyc/bootstrap-in-a-snap/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/builds/squint-nyc/bootstrap-in-a-snap/package.json'
npm ERR! enoent This is related to npm not being able to find a file.

My folder structure (relative to /builds/squint-nyc/bootstrap-in-a-snap/) is as follows:

.releaserc.json
.gitlab-ci.yml
Packages/com.squintopera.unity.bootstrap/package.json

And here is my releaserc.json. Am I doing something wrong, or is it a bug in SemanticRelease?

{
  "branch": "master",
  "tagFormat": "v${version}",
  "plugins": [
    ["@semantic-release/commit-analyzer", { 
      "preset": "angular" 
    }],
    "@semantic-release/release-notes-generator",
    ["@semantic-release/npm", { 
      "npmPublish": true,
      "pkgRoot": "./Packages/com.squintopera.unity.bootstrap"
    }],
    ["@semantic-release/changelog", { 
      "preset": "angular",
      "changelogFile": "CHANGELOG.md"
    }],
    ["@semantic-release/git", {
      "assets": [
        "package.json",
        "README.md",
        "CHANGELOG.md",
        "Packages/com.squintopera.unity.bootstrap/**/*.*"
      ],
      "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
    }],
    "@semantic-release/gitlab"
  ]
}

And here is my gitlab-ci.yml

image: node:18.7.0-buster-slim

stages:
  - release

variables:
  GIT_STRATEGY: fetch
  GIT_SUBMODULE_STRATEGY: recursive
  GIT_DEPTH: "0"
  GITLAB_TOKEN: $CI_API_TOKEN
  PKG_ROOT: Packages/com.squintopera.unity.bootstrap
  
package:
  stage: release
  only:
    - master
  before_script:
    - apt-get update && apt-get install -y --no-install-recommends git-core git-lfs ca-certificates
    - npm install -g semantic-release @semantic-release/git @semantic-release/changelog @semantic-release/gitlab
  script:
    - git lfs pull
    - | # Rename Samples to Samples~ for packaging
      if [[ -d "$PKG_ROOT/Samples" ]]; then
        mv $PKG_ROOT/Samples $PKG_ROOT/Samples~
        rm -f $PKG_ROOT/Samples.meta
      fi
    - | # Run semantic-release to generate changelog, bump version number, and push package
      npm config set com.squintopera.unity:registry ${NPM_REGISTRY_URL}
      npm config set '${NPM_REGISTRY_AUTH}' "${NPM_REGISTRY_TOKEN}"
      export NPM_TOKEN=${NPM_REGISTRY_TOKEN}
      npm run semantic-release
@jedwards1211
Copy link

dupe of #504

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

2 participants