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

Dependent package #154

Open
Tomerfi1210 opened this issue Apr 8, 2024 · 1 comment
Open

Dependent package #154

Tomerfi1210 opened this issue Apr 8, 2024 · 1 comment

Comments

@Tomerfi1210
Copy link

Tomerfi1210 commented Apr 8, 2024

Hey,
I have a monorepo project with this tree:

app/
 --common
   |--package.json
 --app1
   |--package.json
 --app2
   |--package.json

For now, when I there is a change in app1 or app2, a new tag and release is happend.
But, I want also to trigger new tag and release when there is a change in common directory.

Im using gitlab, npm and lerna for that.

Example of package.json in app1:

{
  "name": "app1",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "semantic-release": "lerna exec --concurrency 1 -- semantic-release -e semantic-release-monorepo --tag-format='${LERNA_PACKAGE_NAME}-v\\${version}'"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@semantic-release/changelog": "github:semantic-release/changelog",
    "@semantic-release/commit-analyzer": "github:semantic-release/commit-analyzer",
    "@semantic-release/git": "github:semantic-release/git",
    "@semantic-release/release-notes-generator": "github:semantic-release/release-notes-generator",
    "@semantic-release/npm": "github:semantic-release/npm",
    "conventional-changelog-conventionalcommits": "^7.0.2",
    "semantic-release-monorepo": "^8.0.2"
  },
  "release": {
    "monorepo": {
      "dependencies": [
        "common"
      ]
    },
    "branches": [
      "dev",
      "master"
    ],
    "plugins": [
      "@semantic-release/changelog",
      [
        "@semantic-release/commit-analyzer",
        {
          "preset": "conventionalcommits",
          "presetConfig": {
            "types": [
              {
                "type": "feat",
                "section": "Features"
              },
              {
                "type": "fix",
                "section": "Bug Fixes"
              },
              {
                "type": "chore",
                "hidden": true
              },
              {
                "type": "docs",
                "hidden": true
              },
              {
                "type": "style",
                "hidden": true
              },
              {
                "type": "refactor",
                "hidden": true
              },
              {
                "type": "perf",
                "hidden": true
              },
              {
                "type": "test",
                "hidden": true
              }
            ],
            "issueUrlFormat": ""
          }
        }
      ],
      "@semantic-release/release-notes-generator",
      [
        "@semantic-release/gitlab",
        {
          "gitlabUrl": ""
        }
      ]
    ],
    "repositoryUrl": ""
  }
}

Thank you !

@coreyar
Copy link

coreyar commented Nov 20, 2024

My first thought would be to break out your releases into multiple stages.

  • First release the common package
  • Update app1 and app2 dependencies and commit new lock file.
  • Release app1 and app2

You'll want to consider the range of versions you want app1 and app2 to automatically accept from common i.e. non breaking changes. To avoid automatic breaking releases of app1 and app2

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