File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ function update_module_version() {
31
31
local v2version=" ${2} "
32
32
local modules
33
33
run go mod tidy
34
- modules=$( run go list -f ' {{if not .Main}}{{if not .Indirect}}{{ .Path}}{{end}}{{end}} ' -m all )
34
+ modules=$( go mod edit -json | jq -r ' .Require[] | select( .Indirect == null) | .Path' )
35
35
36
36
v3deps=$( echo " ${modules} " | grep -E " ${ROOT_MODULE} /.*/v3" )
37
37
for dep in ${v3deps} ; do
@@ -97,16 +97,16 @@ function push_mod_tags_cmd {
97
97
98
98
# Any module ccan be used for this
99
99
local main_version
100
- main_version=$( go list -f ' {{.Version}} ' -m " ${ROOT_MODULE} /api/v3" )
100
+ main_version=$( go mod edit -json | jq -r ' .Require[] | select(.Path == " ' " ${ROOT_MODULE} " ' /api/v3") | .Version ' )
101
101
local tags=()
102
102
103
103
keyid=$( get_gpg_key) || return 2
104
104
105
105
for module in $( modules) ; do
106
106
local version
107
- version=$( go list -f ' {{.Version}} ' -m " ${module} " )
107
+ version=$( go mod edit -json | jq -r ' .Require[] | select(.Path == " ' " ${module} " ' ") | .Version ' )
108
108
local path
109
- path=$( go list -f ' {{. Path}} ' -m " ${module} " )
109
+ path=$( go mod edit -json | jq -r ' .Require[] | select(. Path == " ' " ${module} " ' ") | .Path ' )
110
110
local subdir=" ${path// ${ROOT_MODULE} \/ / } "
111
111
local tag
112
112
if [ -z " ${version} " ]; then
@@ -121,7 +121,7 @@ function push_mod_tags_cmd {
121
121
# consider main-module's tag as the latest.
122
122
run sleep 2
123
123
run git tag --local-user " ${keyid} " --sign " ${tag} " --message " ${version} "
124
- tags=( " ${tags[@]} " " ${tag} " )
124
+ tags+=( " ${tag} " )
125
125
done
126
126
maybe_run git push -f " ${REMOTE_REPO} " " ${tags[@]} "
127
127
}
You can’t perform that action at this time.
0 commit comments