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

Make semantic-release sync Helm Chart.yaml version with package.json version #249

Open
thedanchez opened this issue May 19, 2022 · 1 comment

Comments

@thedanchez
Copy link

thedanchez commented May 19, 2022

My application has a Helm chart that is used to deploy my app to Kubernetes whenever I do a release. It is located in a subdirectory called deploy in my root project directory.

app/
-- package.json
-- deploy/
---- Chart.yaml (want to sync this with package.json)

Is there a way to have semantic-release update the version field in that file (to be synced with the updated package.json version) as part of its process and also include it as part of the chore(release): x.x.x [skip ci] commit changeset that it generates?

@thedanchez thedanchez changed the title Sync Helm Chart.yaml file with package.json after semantic-release Sync Helm Chart.yaml version with package.json version after semantic-release May 19, 2022
@thedanchez thedanchez changed the title Sync Helm Chart.yaml version with package.json version after semantic-release Sync Helm Chart.yaml version with package.json version with semantic-release May 19, 2022
@thedanchez thedanchez changed the title Sync Helm Chart.yaml version with package.json version with semantic-release Make semantic-release sync Helm Chart.yaml version with package.json version May 19, 2022
@SimonGolms
Copy link

SimonGolms commented Nov 15, 2022

A bit late, but I solved it as follows:

// .releaserc.js
module.exports = {
  plugins: [
    // ...
    [
      '@semantic-release/exec',
      {
        // WORKAROUND: Use of `case` command, because not all shell versions can interpret the `if` statement syntax correctly
        // Maximum system compatibility between Windows, Linux and MacOS, since `sed -i` behaves differently on each type.
        verifyReleaseCmd:
          "case $OSTYPE in darwin*) SEDOPTION=\" \";; esac && \
           sed -i$SEDOPTION'' -e 's/version:.*/version: ${nextRelease.version}/g' deploy/Chart.yaml && \
           sed -i$SEDOPTION'' -e 's/appVersion:.*/appVersion: \"${nextRelease.version}\"/g' deploy/Chart.yaml",
      },
    ],
  ],
};

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