Skip to content

Commit 669a68c

Browse files
committed
chore(release): auto configure changelog genreartion for stable/pre releases. Fixes #4248 (#4491)
1 parent c31a346 commit 669a68c

File tree

2 files changed

+33
-6
lines changed

2 files changed

+33
-6
lines changed

hack/cherry-pick.sh

+14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
#!/bin/bash
2+
#
3+
# Copyright 2020 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
216

317
set -e
418

hack/release.sh

+19-6
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
set -xe
17+
set -e
1818

1919
TAG_NAME=$1
2020
BRANCH=$2
2121
REPO=kubeflow/pipelines
2222

2323
if [[ -z "$BRANCH" || -z "$TAG_NAME" ]]; then
24-
echo "Usage: release.sh <release-tag> <release-branch>" >&2
24+
echo "Usage: ./hack/release.sh <release-tag> <release-branch>" >&2
2525
exit 1
2626
fi
2727

@@ -31,16 +31,29 @@ git clone "[email protected]:${REPO}.git" "$clone_dir"
3131
cd "$clone_dir"
3232
git checkout "$BRANCH"
3333

34+
echo "Preparing local git tags used by changelog generation."
35+
# tags with "-" are pre-releases, e.g. 1.0.0-rc.1
36+
if [[ "$TAG_NAME" =~ "-" ]]; then
37+
echo "Releasing a pre-release $TAG_NAME."
38+
else
39+
echo "Releasing a stable release $TAG_NAME."
40+
echo "Deleting all local pre-release tags to generate changelog from the last stable release. See issue https://github.com/kubeflow/pipelines/issues/4248.".
41+
for tag in $(git tag | grep -)
42+
do
43+
git tag -d "$tag"
44+
done
45+
fi
46+
47+
echo "Running the ./hack/release-imp.sh script in cloned repo"
3448
echo -n "$TAG_NAME" > ./VERSION
35-
# Run the release script in cloned repo
36-
"hack/release-imp.sh" $TAG_NAME
49+
"hack/release-imp.sh"
3750

38-
# Checking-in the component changes
51+
echo "Checking in the version bump changes"
3952
git add --all
4053
git commit --message "chore(release): bumped version to $TAG_NAME"
4154
git tag -a "$TAG_NAME" -m "Kubeflow Pipelines $TAG_NAME release"
4255

43-
# Pushing the changes upstream
56+
echo "Pushing the changes upstream"
4457
read -p "Do you want to push the version change and tag $TAG_NAME tag to upstream? [y|n]"
4558
if [ "$REPLY" != "y" ]; then
4659
exit

0 commit comments

Comments
 (0)