Skip to content

Commit 1a80079

Browse files
move changelog script
1 parent 8d1462c commit 1a80079

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"e2e:run-server": "node dist/web/server.js",
8282
"e2e:install": "npx playwright install --with-deps",
8383
"e2e:show-report": "npx playwright show-report tests/report",
84-
"update-changelog": "./update-changelog.sh",
84+
"update-changelog": "./scripts/changelog/update-changelog.sh",
8585
"prepare": "husky"
8686
},
8787
"author": "O(1) Labs",
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Ensure that you have the necessary permissions to commit and push changes to the repository.
2020

2121
# Step 1: Capture the latest version
22-
latest_version=$(grep -oP '\[\K[0-9]+\.[0-9]+\.[0-9]+(?=\])' CHANGELOG.md | head -1)
22+
latest_version=$(grep -o '\[\K[0-9]+\.[0-9]+\.[0-9]+(?=\])' CHANGELOG.md | head -1)
2323
echo "Latest version: $latest_version"
2424

2525
# Step 2: Bump the patch version
@@ -37,11 +37,17 @@ current_date=$(date +%Y-%m-%d)
3737
echo "Current date: $current_date"
3838

3939
# Step 5: Extract the second SHA from the compare URL of the latest version
40-
previous_commit=$(grep -m 1 -oP '\[.*?\]\(https://github.com/o1-labs/o1js/compare/[a-f0-9]+\.\.\.\K[a-f0-9]+(?=\))' CHANGELOG.md)
40+
previous_commit=$(grep -m 1 -o '\[.*?\]\(https://github.com/o1-labs/o1js/compare/[a-f0-9]+\.\.\.\K[a-f0-9]+(?=\))' CHANGELOG.md)
4141
echo "Previous commit: $previous_commit"
4242

4343
# Step 6: Update the CHANGELOG
4444
sed -i "s/\[Unreleased\](.*\.\.\.HEAD)/\[Unreleased\](https:\/\/github.com\/o1-labs\/o1js\/compare\/$current_commit...HEAD)\n\n## \[$new_version\](https:\/\/github.com\/o1-labs\/o1js\/compare\/$previous_commit...$current_commit) - $current_date/" CHANGELOG.md
4545

46-
# Step 7: Auto-fix compare URLs for all past versions
47-
node fix-changelog-links.cjs
46+
# Step 7: Auto-fix compare URLs for all past versions, if -r is set
47+
while getopts "r" opt; do
48+
case $opt in
49+
r)
50+
node scripts/changelog/fix-changelog-links.cjs
51+
;;
52+
esac
53+
done

0 commit comments

Comments
 (0)