Skip to content

Commit

Permalink
upgrade to latest dependencies (#5864)
Browse files Browse the repository at this point in the history
bumping knative.dev/hack b96d65a...11d193b:
  > 11d193b 1.0 Backports (# 99)
bumping knative.dev/hack/schema b96d65a...11d193b:
  > 11d193b 1.0 Backports (# 99)

Signed-off-by: Knative Automation <automation@knative.team>
  • Loading branch information
knative-automation authored Nov 1, 2021
1 parent 4de0da0 commit 5263765
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 16 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ require (
k8s.io/apiserver v0.21.4
k8s.io/client-go v0.21.4
k8s.io/utils v0.0.0-20201110183641-67b214c5f920
knative.dev/hack v0.0.0-20211028194650-b96d65a5ff5e
knative.dev/hack/schema v0.0.0-20211028194650-b96d65a5ff5e
knative.dev/hack v0.0.0-20211101195839-11d193bf617b
knative.dev/hack/schema v0.0.0-20211101195839-11d193bf617b
knative.dev/pkg v0.0.0-20211028235650-5d9d300c2e40
knative.dev/reconciler-test v0.0.0-20211029073051-cff9b538d33c
sigs.k8s.io/yaml v1.3.0
Expand Down
7 changes: 4 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1124,10 +1124,11 @@ k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 h1:vEx13qjvaZ4yfObSSXW7Br
k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE=
k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw=
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
knative.dev/hack v0.0.0-20211028194650-b96d65a5ff5e h1:0Hw2xdWYbcs2JRJnOLzAVh7APOtgro7gSno0228mnDg=
knative.dev/hack v0.0.0-20211028194650-b96d65a5ff5e/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack/schema v0.0.0-20211028194650-b96d65a5ff5e h1:4bwydBOPg+8w082m8rRMm8QN4GbvzrHbdZV6tTc8ZO4=
knative.dev/hack/schema v0.0.0-20211028194650-b96d65a5ff5e/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0=
knative.dev/hack v0.0.0-20211101195839-11d193bf617b h1:DaW1iliZlBAwq/I8gTqVu8UnfGxyb5yR7CDsJi5jyWk=
knative.dev/hack v0.0.0-20211101195839-11d193bf617b/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack/schema v0.0.0-20211101195839-11d193bf617b h1:JOgthVSSFclFlbKn+w4yFrkU2E+hBfF0as3z3owHPAo=
knative.dev/hack/schema v0.0.0-20211101195839-11d193bf617b/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0=
knative.dev/pkg v0.0.0-20211028235650-5d9d300c2e40 h1:eOOOqcj+IHIp5te9GGZsrq6vCXUv2y5JItRT3nXHs20=
knative.dev/pkg v0.0.0-20211028235650-5d9d300c2e40/go.mod h1:HyEqMTLzT2hGCisGaRMGzEE8b4Ym+7mhmVx5ygiX+fY=
knative.dev/reconciler-test v0.0.0-20211029073051-cff9b538d33c h1:SQ5ag46cbR0ZCJ49zc4F/+hGs0JdudsLaLpt6vSSX+E=
Expand Down
50 changes: 41 additions & 9 deletions vendor/knative.dev/hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,18 @@ function master_version() {
echo "${tokens[0]}.${tokens[1]}"
}

# Return the minor version of a release.
# For example, "v0.2.1" returns "2"
# Parameters: $1 - release version label.
function minor_version() {
local tokens=(${1//\./ })
echo "${tokens[1]}"
}

# Return the release build number of a release.
# For example, "v0.2.1" returns "1".
# Parameters: $1 - release version label.
function release_build_number() {
function patch_version() {
local tokens=(${1//\./ })
echo "${tokens[2]}"
}
Expand Down Expand Up @@ -171,7 +179,10 @@ function prepare_auto_release() {
PUBLISH_RELEASE=1

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

echo "Versions released (from tags): [" "${tags}" "]"
Expand Down Expand Up @@ -210,7 +221,10 @@ function prepare_dot_release() {
git fetch --all || abort "error fetching branches/tags from remote"
# List latest release
local releases # don't combine with the line below, or $? will be 0
releases="$(hub_tool release)"
# Support tags in two formats
# - knative-v1.0.0
# - v1.0.0
releases="$(hub_tool release | cut -d '-' -f2)"
echo "Current releases are: ${releases}"
[[ $? -eq 0 ]] || abort "cannot list releases"
# If --release-branch passed, restrict to that release
Expand All @@ -234,7 +248,9 @@ function prepare_dot_release() {
[[ -n "${major_minor_version}" ]] || abort "cannot get release major/minor version"
# Ensure there are new commits in the branch, otherwise we don't create a new release
setup_branch
local last_release_commit="$(git rev-list -n 1 "${last_version}")"
# Use the original tag (ie. potentially with a knative- prefix) when determining the last version commit sha
local github_tag="$(hub_tool release | grep "${last_version}")"
local last_release_commit="$(git rev-list -n 1 "${github_tag}")"
local release_branch_commit="$(git rev-list -n 1 upstream/"${RELEASE_BRANCH}")"
[[ -n "${last_release_commit}" ]] || abort "cannot get last release commit"
[[ -n "${release_branch_commit}" ]] || abort "cannot get release branch last commit"
Expand All @@ -246,13 +262,13 @@ function prepare_dot_release() {
exit 0
fi
# Create new release version number
local last_build="$(release_build_number "${last_version}")"
local last_build="$(patch_version "${last_version}")"
RELEASE_VERSION="${major_minor_version}.$(( last_build + 1 ))"
echo "Will create release ${RELEASE_VERSION} at commit ${release_branch_commit}"
# If --release-notes not used, copy from the latest release
if [[ -z "${RELEASE_NOTES}" ]]; then
RELEASE_NOTES="$(mktemp)"
hub_tool release show -f "%b" "${last_version}" > "${RELEASE_NOTES}"
hub_tool release show -f "%b" "${github_tag}" > "${RELEASE_NOTES}"
echo "Release notes from ${last_version} copied to ${RELEASE_NOTES}"
fi
}
Expand Down Expand Up @@ -595,6 +611,8 @@ function publish_to_github() {
local description="$(mktemp)"
local attachments_dir="$(mktemp -d)"
local commitish=""
local github_tag="knative-${TAG}"

# Copy files to a separate dir
for artifact in $@; do
cp ${artifact} "${attachments_dir}"/
Expand All @@ -604,16 +622,30 @@ function publish_to_github() {
if [[ -n "${RELEASE_NOTES}" ]]; then
cat "${RELEASE_NOTES}" >> "${description}"
fi
git tag -a "${TAG}" -m "${title}"
git_push tag "${TAG}"
git tag -a "${github_tag}" -m "${title}"
git_push tag "${github_tag}"

# Include a tag for the go module version
#
# v1.0.0 = v0.27.0
# v1.0.1 = v0.27.1
# v1.1.1 = v0.28.1
#
# See: https://github.com/knative/hack/pull/97
if [[ "$TAG" == "v1"* ]]; then
local release_minor=$(minor_version $TAG)
local go_module_version="v0.$(( release_minor + 27 )).$(patch_version $TAG)"
git tag -a "${go_module_version}" -m "${title}"
git_push tag "${go_module_version}"
fi

[[ -n "${RELEASE_BRANCH}" ]] && commitish="--commitish=${RELEASE_BRANCH}"
for i in {2..0}; do
hub_tool release create \
${attachments[@]} \
--file="${description}" \
"${commitish}" \
"${TAG}" && return 0
"${github_tag}" && return 0
if [[ "${i}" -gt 0 ]]; then
echo "Error publishing the release, retrying in 15s..."
sleep 15
Expand Down
4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1002,11 +1002,11 @@ k8s.io/utils/buffer
k8s.io/utils/integer
k8s.io/utils/pointer
k8s.io/utils/trace
# knative.dev/hack v0.0.0-20211028194650-b96d65a5ff5e
# knative.dev/hack v0.0.0-20211101195839-11d193bf617b
## explicit
knative.dev/hack
knative.dev/hack/shell
# knative.dev/hack/schema v0.0.0-20211028194650-b96d65a5ff5e
# knative.dev/hack/schema v0.0.0-20211101195839-11d193bf617b
## explicit
knative.dev/hack/schema/commands
knative.dev/hack/schema/docs
Expand Down

0 comments on commit 5263765

Please sign in to comment.