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

Help with release-please-action Configuration for a Project with Nested package.json #2155

Closed
jevgenijsblaus opened this issue Dec 7, 2023 · 3 comments
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@jevgenijsblaus
Copy link

Hi GitHub Community,

I'm currently working on a project that has a unique structure and I'm facing challenges configuring the release-please-action correctly. My project structure is as follows:

.github/
app/
  |- src/
  |_ package.json
docs/
CHANGELOG.md
README.md

My objective is to manage releases for the entire project, encompassing changes both in the root directory and within the app/ directory, where all source files and package managers files like package.json and composer.json are located. However, since the CHANGELOG.md is located in the root of the repository and there is no package.json file at this level, I am seeking a solution to update the changelog as part of the release process managed by release-please-action, despite the absence of package.json in the root directory.

I've tried the following configurations in my release-please-config.json, but I'm encountering errors:

{
    "packages": {
        "app": {
            "package-name": "laravel-app"
        },
        ".": {
            "changelog-path": "CHANGELOG.md"
        },
    },
    "changelog-sections": [
        // sections here
    ]
}

This configuration results in the following error:

Error: release-please failed: node (org/laravel-app): Missing required file: package.json

{
    "packages": {
        "app": {
            "package-name": "laravel-app",
            "changelog-path": "./../CHANGELOG.md"
        }
    },
    "changelog-sections": [
        // sections here
    ]
}

However, this leads to a different error:

Error: release-please failed: illegal pathing characters in path: app/../CHANGELOG.md

I am looking for guidance on how to correctly set up the release-please-config.json for my project structure. Specifically, I need to handle releases for the package in the app/ directory while keeping the CHANGELOG.md in the root directory. Any advice or suggestions on how to configure this properly would be greatly appreciated.

Thank you in advance for your help!

@jevgenijsblaus jevgenijsblaus added priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue. labels Dec 7, 2023
@chingor13
Copy link
Contributor

For changelog-path, try /CHANGELOG.md. An "absolute" path is calculated from the root of the repository.

{
    "packages": {
        "app": {
            "package-name": "laravel-app",
            "changelog-path": "/CHANGELOG.md"
        }
    },
    "changelog-sections": [
        // sections here
    ]
}

@jevgenijsblaus
Copy link
Author

@chingor13, thank you for your suggestion to use an "absolute" path for the changelog-path. I tried updating my release-please-config.json as you recommended:

{
    "packages": {
        "app": {
            "package-name": "laravel-app",
            "changelog-path": "/CHANGELOG.md"
        }
    },
    "changelog-sections": [
        // sections here
    ]
}

However, I'm still encountering an issue where the CHANGELOG.md is being created in the app directory, rather than in the root directory of the repository.

@chingor13
Copy link
Contributor

Please ensure that the config is in your release branch.

Tested using the CLI with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

2 participants