forked from opendatahub-io/data-science-pipelines
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·71 lines (63 loc) · 2.1 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
#
# Copyright 2020 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
TAG=$1
BRANCH=$2
REPO=kubeflow/pipelines
if [[ -z "$BRANCH" || -z "$TAG" ]]; then
echo "Usage: ./test/release/release.sh <release-tag> <release-branch>" >&2
exit 1
fi
# Checking out the repo's release branch
clone_dir="$(mktemp -d)"
# Use GitHub CLI if found, otherwise use git clone.
if which gh; then
gh repo clone github.com/${REPO} "${clone_dir}"
else
git clone "[email protected]:${REPO}.git" "${clone_dir}"
fi
cd "$clone_dir"
git checkout "$BRANCH"
echo "Preparing local git tags used by changelog generation."
# tags with "-" are pre-releases, e.g. 1.0.0-rc.1
if [[ "$TAG" =~ "-" ]]; then
echo "Releasing a pre-release $TAG."
else
echo "Releasing a stable release $TAG."
echo "Deleting all local pre-release tags to generate changelog from the last stable release. See issue https://github.com/kubeflow/pipelines/issues/4248.".
for tag in $(git tag | grep -)
do
git tag -d "$tag"
done
fi
echo "Running the bump version script in cloned repo"
echo -n "$TAG" > ./VERSION
# TODO(Bobgy): pin image tag
PREBUILT_REMOTE_IMAGE=gcr.io/ml-pipeline-test/release:latest
pushd ./test/release
make release-in-place
popd
echo "Checking in the version bump changes"
git add --all
git commit --message "chore(release): bumped version to $TAG"
git tag -a "$TAG" -m "Kubeflow Pipelines $TAG release"
echo "Pushing the changes upstream"
read -p "Do you want to push the version change and tag $TAG tag to upstream? [y|n]"
if [ "$REPLY" != "y" ]; then
exit
fi
git push --set-upstream origin "$BRANCH"
git push origin "$TAG"