Skip to content

Commit c55cddc

Browse files
upgrade to latest dependencies (#551)
bumping knative.dev/hack/schema b96d65a...11d193b: > 11d193b 1.0 Backports (# 99) bumping knative.dev/hack b96d65a...11d193b: > 11d193b 1.0 Backports (# 99) Signed-off-by: Knative Automation <[email protected]>
1 parent ed00159 commit c55cddc

File tree

4 files changed

+49
-16
lines changed

4 files changed

+49
-16
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
k8s.io/client-go v0.21.4
1212
k8s.io/code-generator v0.21.4
1313
k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7
14-
knative.dev/hack v0.0.0-20211028194650-b96d65a5ff5e
15-
knative.dev/hack/schema v0.0.0-20211028194650-b96d65a5ff5e
14+
knative.dev/hack v0.0.0-20211101195839-11d193bf617b
15+
knative.dev/hack/schema v0.0.0-20211101195839-11d193bf617b
1616
knative.dev/pkg v0.0.0-20211028235650-5d9d300c2e40
1717
)

go.sum

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,10 +1082,11 @@ k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 h1:vEx13qjvaZ4yfObSSXW7Br
10821082
k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE=
10831083
k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw=
10841084
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
1085-
knative.dev/hack v0.0.0-20211028194650-b96d65a5ff5e h1:0Hw2xdWYbcs2JRJnOLzAVh7APOtgro7gSno0228mnDg=
10861085
knative.dev/hack v0.0.0-20211028194650-b96d65a5ff5e/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
1087-
knative.dev/hack/schema v0.0.0-20211028194650-b96d65a5ff5e h1:4bwydBOPg+8w082m8rRMm8QN4GbvzrHbdZV6tTc8ZO4=
1088-
knative.dev/hack/schema v0.0.0-20211028194650-b96d65a5ff5e/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0=
1086+
knative.dev/hack v0.0.0-20211101195839-11d193bf617b h1:DaW1iliZlBAwq/I8gTqVu8UnfGxyb5yR7CDsJi5jyWk=
1087+
knative.dev/hack v0.0.0-20211101195839-11d193bf617b/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
1088+
knative.dev/hack/schema v0.0.0-20211101195839-11d193bf617b h1:JOgthVSSFclFlbKn+w4yFrkU2E+hBfF0as3z3owHPAo=
1089+
knative.dev/hack/schema v0.0.0-20211101195839-11d193bf617b/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0=
10891090
knative.dev/pkg v0.0.0-20211028235650-5d9d300c2e40 h1:eOOOqcj+IHIp5te9GGZsrq6vCXUv2y5JItRT3nXHs20=
10901091
knative.dev/pkg v0.0.0-20211028235650-5d9d300c2e40/go.mod h1:HyEqMTLzT2hGCisGaRMGzEE8b4Ym+7mhmVx5ygiX+fY=
10911092
pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=

vendor/knative.dev/hack/release.sh

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,18 @@ function master_version() {
131131
echo "${tokens[0]}.${tokens[1]}"
132132
}
133133

134+
# Return the minor version of a release.
135+
# For example, "v0.2.1" returns "2"
136+
# Parameters: $1 - release version label.
137+
function minor_version() {
138+
local tokens=(${1//\./ })
139+
echo "${tokens[1]}"
140+
}
141+
134142
# Return the release build number of a release.
135143
# For example, "v0.2.1" returns "1".
136144
# Parameters: $1 - release version label.
137-
function release_build_number() {
145+
function patch_version() {
138146
local tokens=(${1//\./ })
139147
echo "${tokens[2]}"
140148
}
@@ -171,7 +179,10 @@ function prepare_auto_release() {
171179
PUBLISH_RELEASE=1
172180

173181
git fetch --all || abort "error fetching branches/tags from remote"
174-
local tags="$(git tag | cut -d 'v' -f2 | cut -d '.' -f1-2 | sort -V | uniq)"
182+
# Support two different formats for tags
183+
# - knative-v1.0.0
184+
# - v1.0.0
185+
local tags="$(git tag | cut -d '-' -f2 | cut -d 'v' -f2 | cut -d '.' -f1-2 | sort -V | uniq)"
175186
local branches="$( { (git branch -r | grep upstream/release-) ; (git branch | grep release-); } | cut -d '-' -f2 | sort -V | uniq)"
176187

177188
echo "Versions released (from tags): [" "${tags}" "]"
@@ -210,7 +221,10 @@ function prepare_dot_release() {
210221
git fetch --all || abort "error fetching branches/tags from remote"
211222
# List latest release
212223
local releases # don't combine with the line below, or $? will be 0
213-
releases="$(hub_tool release)"
224+
# Support tags in two formats
225+
# - knative-v1.0.0
226+
# - v1.0.0
227+
releases="$(hub_tool release | cut -d '-' -f2)"
214228
echo "Current releases are: ${releases}"
215229
[[ $? -eq 0 ]] || abort "cannot list releases"
216230
# If --release-branch passed, restrict to that release
@@ -234,7 +248,9 @@ function prepare_dot_release() {
234248
[[ -n "${major_minor_version}" ]] || abort "cannot get release major/minor version"
235249
# Ensure there are new commits in the branch, otherwise we don't create a new release
236250
setup_branch
237-
local last_release_commit="$(git rev-list -n 1 "${last_version}")"
251+
# Use the original tag (ie. potentially with a knative- prefix) when determining the last version commit sha
252+
local github_tag="$(hub_tool release | grep "${last_version}")"
253+
local last_release_commit="$(git rev-list -n 1 "${github_tag}")"
238254
local release_branch_commit="$(git rev-list -n 1 upstream/"${RELEASE_BRANCH}")"
239255
[[ -n "${last_release_commit}" ]] || abort "cannot get last release commit"
240256
[[ -n "${release_branch_commit}" ]] || abort "cannot get release branch last commit"
@@ -246,13 +262,13 @@ function prepare_dot_release() {
246262
exit 0
247263
fi
248264
# Create new release version number
249-
local last_build="$(release_build_number "${last_version}")"
265+
local last_build="$(patch_version "${last_version}")"
250266
RELEASE_VERSION="${major_minor_version}.$(( last_build + 1 ))"
251267
echo "Will create release ${RELEASE_VERSION} at commit ${release_branch_commit}"
252268
# If --release-notes not used, copy from the latest release
253269
if [[ -z "${RELEASE_NOTES}" ]]; then
254270
RELEASE_NOTES="$(mktemp)"
255-
hub_tool release show -f "%b" "${last_version}" > "${RELEASE_NOTES}"
271+
hub_tool release show -f "%b" "${github_tag}" > "${RELEASE_NOTES}"
256272
echo "Release notes from ${last_version} copied to ${RELEASE_NOTES}"
257273
fi
258274
}
@@ -595,6 +611,8 @@ function publish_to_github() {
595611
local description="$(mktemp)"
596612
local attachments_dir="$(mktemp -d)"
597613
local commitish=""
614+
local github_tag="knative-${TAG}"
615+
598616
# Copy files to a separate dir
599617
for artifact in $@; do
600618
cp ${artifact} "${attachments_dir}"/
@@ -604,16 +622,30 @@ function publish_to_github() {
604622
if [[ -n "${RELEASE_NOTES}" ]]; then
605623
cat "${RELEASE_NOTES}" >> "${description}"
606624
fi
607-
git tag -a "${TAG}" -m "${title}"
608-
git_push tag "${TAG}"
625+
git tag -a "${github_tag}" -m "${title}"
626+
git_push tag "${github_tag}"
627+
628+
# Include a tag for the go module version
629+
#
630+
# v1.0.0 = v0.27.0
631+
# v1.0.1 = v0.27.1
632+
# v1.1.1 = v0.28.1
633+
#
634+
# See: https://github.com/knative/hack/pull/97
635+
if [[ "$TAG" == "v1"* ]]; then
636+
local release_minor=$(minor_version $TAG)
637+
local go_module_version="v0.$(( release_minor + 27 )).$(patch_version $TAG)"
638+
git tag -a "${go_module_version}" -m "${title}"
639+
git_push tag "${go_module_version}"
640+
fi
609641

610642
[[ -n "${RELEASE_BRANCH}" ]] && commitish="--commitish=${RELEASE_BRANCH}"
611643
for i in {2..0}; do
612644
hub_tool release create \
613645
${attachments[@]} \
614646
--file="${description}" \
615647
"${commitish}" \
616-
"${TAG}" && return 0
648+
"${github_tag}" && return 0
617649
if [[ "${i}" -gt 0 ]]; then
618650
echo "Error publishing the release, retrying in 15s..."
619651
sleep 15

vendor/modules.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,10 @@ k8s.io/utils/buffer
695695
k8s.io/utils/integer
696696
k8s.io/utils/pointer
697697
k8s.io/utils/trace
698-
# knative.dev/hack v0.0.0-20211028194650-b96d65a5ff5e
698+
# knative.dev/hack v0.0.0-20211101195839-11d193bf617b
699699
## explicit
700700
knative.dev/hack
701-
# knative.dev/hack/schema v0.0.0-20211028194650-b96d65a5ff5e
701+
# knative.dev/hack/schema v0.0.0-20211101195839-11d193bf617b
702702
## explicit
703703
knative.dev/hack/schema/commands
704704
knative.dev/hack/schema/docs

0 commit comments

Comments
 (0)