Skip to content

Semantic release updates a file correctly, but doesn't include it in the release #512

Open
@testasoft

Description

@testasoft

Hi,

In our semantic release, we added a simple additional step - running a shell script that updates src/Constants/Package.ts file. On inspection we see, that the file is updated and committed. The chore(release) commit includes the correct version of Package.ts file. However the final build of the package only includes the previous state of Package.ts. Meaning, that each subsequent build will have the previous version of Package.ts. So how could the release part ignore the new state of Package.ts, but accept changes on package.json or changelog?

Here's the release.config.js:
export function semanticReleaseConfig(params: Params = defaultParams) { return { branches: [ '+([0-9])?(.{+([0-9]),x}).x', params.defaultBranch ?? defaultParams.defaultBranch, 'next', 'next-major', { name: 'beta', prerelease: true }, { name: 'alpha', prerelease: true }, { name: 'rc', prerelease: true }, ], plugins: [ '@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/changelog', '@semantic-release/gitlab', [ '@semantic-release/npm', { npmPublish: true }, ], [ '@semantic-release/exec', { prepareCmd: './version.sh ${nextRelease.version}', }, ], [ '@semantic-release/git', { assets: [ 'CHANGELOG.md', 'package.json', 'package-lock.json', 'src/Constants/Package.ts', ], }, ], ], }; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions