From 219d3a0e32ac5c2e30a34f49accead5a4e3c85e8 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kaiser Date: Mon, 24 Feb 2025 10:54:42 +0100 Subject: [PATCH 1/2] [no ci] Fix release script does not include the changelog in the tag --- scripts/release.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/release.sh b/scripts/release.sh index de03085f2f..17a23925e4 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -40,7 +40,7 @@ echo "Press Enter when this is done" read step "lerna version" -./node_modules/.bin/lerna version --force-publish --no-push +./node_modules/.bin/lerna version --force-publish --no-push --no-git-tag-version # Get the version from package.json npm_package_version=$(jq -r '.version' ./packages/react-admin/package.json) @@ -56,6 +56,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 git 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" From f2ac8f1e7b2343cda89dc7003b06fe73445ddedb Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kaiser Date: Mon, 24 Feb 2025 11:13:31 +0100 Subject: [PATCH 2/2] [no ci] fix lerna version command --- scripts/release.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/release.sh b/scripts/release.sh index 17a23925e4..8580ad6183 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -40,11 +40,22 @@ echo "Press Enter when this is done" read step "lerna version" -./node_modules/.bin/lerna version --force-publish --no-push --no-git-tag-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." @@ -58,7 +69,7 @@ fi step "git tag" if [ -z "$RELEASE_DRY_RUN" ]; then - echo "Creating git tag v${npm_package_version}" + echo "Creating new tag v${npm_package_version}" git tag "v${npm_package_version}" else echo "dry mode -- skipping git tag"