Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
xorcare committed Sep 21, 2024
1 parent 8a6fd0f commit d35389a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
../go-mod-bump.sh go
git diff --exit-code dc67e0b4138c3487d3b4d5f012b6a3262d2db25e && exit 0 || true
echo "No changes have been detected, but they must be"
exit 1
- name: Test bump modules version
working-directory: tornado
Expand All @@ -63,3 +64,4 @@ jobs:
../go-mod-bump.sh all
git diff --exit-code dc67e0b4138c3487d3b4d5f012b6a3262d2db25e && exit 0 || true
echo "No changes have been detected, but they must be"
exit 1
26 changes: 1 addition & 25 deletions go-mod-bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,28 +110,4 @@ function update_module() {
go build ./...
}

function bump_module() {
module=$(echo "$1" | cut -f1 -d@)
current_version=$(echo "$1" | cut -f2 -d@)
latest_version=$(echo "$1" | cut -f3 -d@)

if ! update_module "${module}@${latest_version}" >/dev/null 2>&1 >/dev/null; then
echoerr "go-mod-bump: failed to update module ${module} from ${current_version} to ${latest_version}"
echoerr "try to update module manually using commands:"
echoerr "go get ${module}@${latest_version}"
echoerr "go mod tidy"
echoerr "go build ./..."
git checkout -f HEAD -- go.mod go.sum
return
fi

git reset HEAD -- . >/dev/null
git add go.mod go.sum >/dev/null
git commit -a -m "${PREFIX}Bump ${module} from ${current_version} to ${latest_version}" >/dev/null

echoerr "go-mod-bump: upgraded ${module} ${current_version} => [${latest_version}]"
}

for mdl in $MODULES_FOR_UPDATE; do
(bump_module "$mdl")
done
echo "DO NOTHING"

0 comments on commit d35389a

Please sign in to comment.