From 1a79aefbcc16d63c598c4847ded8fa2624550518 Mon Sep 17 00:00:00 2001 From: Konstantin Kostov Date: Tue, 6 Feb 2024 11:38:17 +0100 Subject: [PATCH] feat: update changelog when publishing --- setversion.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setversion.sh b/setversion.sh index 8c9eab7..1d34c36 100644 --- a/setversion.sh +++ b/setversion.sh @@ -15,4 +15,11 @@ else sed -i "s/^version: .*/version: ${NEW_VERSION}/g" "pubspec.yaml" fi +# pub.dev requires that the CHANGELOG includes the version number. +# Make sure the CHANGELOG includes this version number. This is optional because it may have been updated manually by another action. +if ! grep -q "## ${NEW_VERSION}" CHANGELOG.md; then + echo "CHANGELOG.md does not include a section for version ${NEW_VERSION}." + echo -e "## ${NEW_VERSION}\n\n- https://github.com/TelemetryDeck/FlutterSDK/releases/tag/${NEW_VERSION}\n\n" | cat - CHANGELOG.md > temp && mv temp CHANGELOG.md +fi + echo "Version updated to ${NEW_VERSION}." \ No newline at end of file