Skip to content

Commit 3b0975f

Browse files
committed
Migrate release
Signed-off-by: Ivan Valdes <[email protected]>
1 parent c8aacb2 commit 3b0975f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/release_mod.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function update_module_version() {
3131
local v2version="${2}"
3232
local modules
3333
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')
3535

3636
v3deps=$(echo "${modules}" | grep -E "${ROOT_MODULE}/.*/v3")
3737
for dep in ${v3deps}; do
@@ -97,16 +97,16 @@ function push_mod_tags_cmd {
9797

9898
# Any module ccan be used for this
9999
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')
101101
local tags=()
102102

103103
keyid=$(get_gpg_key) || return 2
104104

105105
for module in $(modules); do
106106
local version
107-
version=$(go list -f '{{.Version}}' -m "${module}")
107+
version=$(go mod edit -json | jq -r '.Require[] | select(.Path == "'"${module}"'") | .Version')
108108
local path
109-
path=$(go list -f '{{.Path}}' -m "${module}")
109+
path=$(go mod edit -json | jq -r '.Require[] | select(.Path == "'"${module}"'") | .Path')
110110
local subdir="${path//${ROOT_MODULE}\//}"
111111
local tag
112112
if [ -z "${version}" ]; then
@@ -121,7 +121,7 @@ function push_mod_tags_cmd {
121121
# consider main-module's tag as the latest.
122122
run sleep 2
123123
run git tag --local-user "${keyid}" --sign "${tag}" --message "${version}"
124-
tags=("${tags[@]}" "${tag}")
124+
tags+=("${tag}")
125125
done
126126
maybe_run git push -f "${REMOTE_REPO}" "${tags[@]}"
127127
}

0 commit comments

Comments
 (0)