Skip to content

Commit

Permalink
update ci.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
hedzr committed Nov 11, 2024
1 parent 0c97a55 commit 46820ca
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,17 @@
# $0 commit-examples
# 7. push all of them
#
# Using ci.sh to upgrade go modules in current directory, try this:
# [deprecated] END
#
# Howto release the New Version:
#
# 1. `$0 update`: upgrade deps and make security patches
# 2. edit doc.go and CHANGELOG
# 3. `$0 update-main`: upgrade deps to the releasing version of main lib (hedzr/store)
# 4. `make cov`: ensure all tests passed
# 5. commit all, bump version, push all
#
# Using ci.sh to upgrade go modules under current directory, try this:
#
# $0 update
#
Expand Down Expand Up @@ -368,6 +378,29 @@ build-update() {
echo
}

# update all refs in child modules to hedzr/store's releasing version
build-update-main() {
echo "VERSION: $VER"
local ix=0
for sm in "${1:-.}"; do
for f in $(find ./$sm -type f -iname 'go.mod' -print); do
d="$(dirname $f)"
if [ -d "$d" ]; then
echo "*** file: $f ***************"
# echo "d: $d"
sed -i '' -E -e 's#(hedzr/store.*)v[0-9]+\.[0-9]+\.[0-9]+#\1'$VER'#g' $f &&
{ echo " $f: $(grep -E 'hedzr/store.*v\d+' $f)" && [ -f "$f.bak" ] && rm "$f.bak"; } ||
echo " $f: FAILED"
let ix++
# if [[ $ix -gt 2 ]]; then
# return
# fi
fi
done
done
echo
}

build-update-cmdr() {
for sm in ../cmdr ../tool.rd ../tool.zag; do
for f in $(find ./$sm -type f -iname 'go.mod' -print); do
Expand Down

0 comments on commit 46820ca

Please sign in to comment.