Skip to content

Commit

Permalink
ci(release): include README.md in version update
Browse files Browse the repository at this point in the history
  • Loading branch information
ccamel committed Dec 23, 2024
1 parent 4242ac8 commit 5ece0c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ plugins:
- path: "./target/release/sha256sum.txt"
- - "@semantic-release/git"
- assets:
- README.md
- CHANGELOG.md
- version
- go.mod
Expand Down
17 changes: 12 additions & 5 deletions scripts/bump-module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5ece0c3

Please sign in to comment.