semantic-release / semantic-release/git

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

Open
#512 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
339
Forks
75
Avg merge
5h 15m
Merged PRs (30d)
6

Description

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', ], }, ], ], }; }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with release.config.js and the version.sh command, then trace the order of the npm, exec, and git plugins. Compare the committed src/Constants/Package.ts with the files included in the final package build. Done means the build includes the updated Package.ts state from the same release.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, javascript, shell, typescript
Domain
release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.