Skip to content

Commit

Permalink
Merge pull request #1484 from o1-labs/feat/add-date-changelog
Browse files Browse the repository at this point in the history
feat(update-changelog.sh): add current date to new entries in CHANGELOG
  • Loading branch information
MartinMinkov authored Mar 6, 2024
2 parents 045c0ed + 68e7442 commit 5a1bb8b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions update-changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
# 1. Identifies the latest version number in the CHANGELOG (following semantic versioning).
# 2. Increments the patch segment of the version number for the new release.
# 3. Retrieves the current Git commit hash and truncates it for brevity.
# 4. Updates the CHANGELOG.md file:
# - Adds a new entry for the upcoming release using the incremented version number.
# 4. Captures the current date in YYYY-MM-DD format.
# 5. Updates the CHANGELOG.md file:
# - Adds a new entry for the upcoming release using the incremented version number and the current date.
# - Updates the link for the [Unreleased] section to point from the current commit to HEAD.
#
# Usage:
Expand All @@ -30,5 +31,9 @@ echo "New version: $new_version"
current_commit=$(git rev-parse HEAD | cut -c 1-9)
echo "Current commit: $current_commit"

# Step 4: Update the CHANGELOG
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\/1ad7333e9e...$current_commit)/" CHANGELOG.md
# Step 4: Capture the current date in YYYY-MM-DD format
current_date=$(date +%Y-%m-%d)
echo "Current date: $current_date"

# Step 5: Update the CHANGELOG
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\/1ad7333e9e...$current_commit) - $current_date/" CHANGELOG.md

0 comments on commit 5a1bb8b

Please sign in to comment.