From 5ece0c35191a79ae6b30e2d5a317da375400ece2 Mon Sep 17 00:00:00 2001 From: ccamel Date: Mon, 23 Dec 2024 13:49:51 +0100 Subject: [PATCH] ci(release): include README.md in version update --- .releaserc.yml | 1 + scripts/bump-module.sh | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.releaserc.yml b/.releaserc.yml index fc87b7d0..28490df2 100644 --- a/.releaserc.yml +++ b/.releaserc.yml @@ -55,6 +55,7 @@ plugins: - path: "./target/release/sha256sum.txt" - - "@semantic-release/git" - assets: + - README.md - CHANGELOG.md - version - go.mod diff --git a/scripts/bump-module.sh b/scripts/bump-module.sh index ca2f41b7..27eff381 100755 --- a/scripts/bump-module.sh +++ b/scripts/bump-module.sh @@ -13,15 +13,22 @@ if [ "${major_version}" -gt 1 ]; then go mod edit -module "${module_name_versioned}" echo "✅ module name updated to ${module_name_versioned} in go.mod" + sed_i_flag="" if [ "$(uname)" = "Darwin" ]; then - find . -type f -name "*.go" -exec \ - sed -i '' "s|\"${module_name}|\"${module_name_versioned}|g" {} \; + sed_i_flag=(-i '') else - find . -type f -name "*.go" -exec \ - sed -i "s|\"${module_name}|\"${module_name_versioned}|g" {} \; + sed_i_flag=(-i) fi - echo "✅ packages updated to ${module_name_versioned} in source files" + echo "⬆️ updating ${module_name} to ${module_name_versioned}..." + find . -type f \( -name "*.go" \) \ + -exec echo " - processing {}" \; \ + -exec sed "${sed_i_flag[@]}" "s|\"${module_name}|\"${module_name_versioned}|g" {} \; + + find . -type f \( -name "README.md" \) \ + -exec echo " - processing {}" \; \ + -exec sed "${sed_i_flag[@]}" "s|${module_name}|${module_name_versioned}|g" {} \; + echo "✅ packages updated to ${module_name_versioned} in source files" echo "🧹 cleaning up go.sum" go mod tidy else