Skip to content

Commit

Permalink
Merge pull request #10544 from marmelab/fix-release-tag-changelog
Browse files Browse the repository at this point in the history
[chore] Fix release script does not include the changelog in the tag
  • Loading branch information
djhi authored Feb 26, 2025
2 parents 67f534b + f2ac8f1 commit 518fbb6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,22 @@ echo "Press Enter when this is done"
read

step "lerna version"
# Running lerna version
# This will create a commit and a tag
./node_modules/.bin/lerna version --force-publish --no-push

# Get the version from package.json
npm_package_version=$(jq -r '.version' ./packages/react-admin/package.json)

# Remove the tag created by lerna
echo "Removing tag v${npm_package_version} created by lerna"
git tag -d "v${npm_package_version}"
if [ ! -z "$RELEASE_DRY_RUN" ]; then
# In dry-run mode, reset the last commit to avoid accidental push
echo "dry mode -- Resetting the workspace to the last commit"
git reset --soft HEAD~1
fi

step "update-changelog"
yarn run update-changelog ${npm_package_version}
echo "Please review the ./CHANGELOG.md file and update it if needed."
Expand All @@ -56,6 +67,14 @@ if [ -z "$RELEASE_DRY_RUN" ]; then
git commit -m "Update changelog for version ${npm_package_version}"
fi

step "git tag"
if [ -z "$RELEASE_DRY_RUN" ]; then
echo "Creating new tag v${npm_package_version}"
git tag "v${npm_package_version}"
else
echo "dry mode -- skipping git tag"
fi

step "git push"
if [ -z "$RELEASE_DRY_RUN" ]; then
echo "Pushing commits and tags to git"
Expand Down

0 comments on commit 518fbb6

Please sign in to comment.