@@ -28,9 +28,9 @@ FIRST_DIGIT="${SCHEMA_VERSION%%.*}"
28
28
RELEASE_BRANCH=" release-v${FIRST_DIGIT} "
29
29
DEVFILE_REPO=
" [email protected] :devfile/registry-operator.git"
30
30
# # This will be uncommented for actual devfile repo
31
- RELEASE_UPSTREAM_NAME=" devfile-upstream-release"
31
+ # RELEASE_UPSTREAM_NAME="devfile-upstream-release"
32
32
# This goes to my origin for testing
33
- # RELEASE_UPSTREAM_NAME="origin"
33
+ RELEASE_UPSTREAM_NAME=" origin"
34
34
35
35
if ! command -v hub > /dev/null; then
36
36
echo " [ERROR] The hub CLI needs to be installed. See https://github.com/github/hub/releases"
@@ -72,11 +72,11 @@ checkoutToReleaseBranch() {
72
72
echo " [INFO] Checking out to $SCHEMA_VERSION branch."
73
73
if git ls-remote -q --heads | grep -q $SCHEMA_VERSION ; then
74
74
echo " [INFO] $SCHEMA_VERSION exists."
75
- # resetChanges $SCHEMA_VERSION --- commented out so it doesnt delete my work when testing
75
+ resetChanges $SCHEMA_VERSION --- commented out so it doesnt delete my work when testing
76
76
else
77
77
echo " [INFO] $SCHEMA_VERSION does not exist. Will create a new one from main."
78
- # resetChanges main --- commented out so it doesnt delete my work when testing
79
- git push origin main :$SCHEMA_VERSION
78
+ resetChanges release-automation --- commented out so it doesnt delete my work when testing # change release-automation to main after testing
79
+ git push origin release-automation :$SCHEMA_VERSION
80
80
fi
81
81
git checkout -B $SCHEMA_VERSION
82
82
}
@@ -117,18 +117,18 @@ commitChanges() {
117
117
# with the name release-vX
118
118
# # This func will be used when we have a new major release and there is no branch in the upstream repo
119
119
createNewReleaseBranch (){
120
- git checkout -b " ${RELEASE_BRANCH} " main
120
+ git checkout -b " ${RELEASE_BRANCH} " release-automation # change to main after testing
121
121
git push " ${RELEASE_UPSTREAM_NAME} " " ${RELEASE_BRANCH} "
122
- # hub sync -- this supposedly will create that branch in upstream
123
122
}
124
123
124
+ # Checks if release-vX branch is in the upstream
125
+ # If it is not it creates the new major release branch based off main
125
126
verifyReleaseBranch () {
126
127
if git ls-remote --exit-code --heads ${RELEASE_UPSTREAM_NAME} " $RELEASE_BRANCH " > /dev/null 2>&1 ; then
127
128
echo " Branch $RELEASE_BRANCH exists in the upstream repository."
128
129
else
129
130
echo " Branch $RELEASE_BRANCH does not exist in the upstream repository."
130
131
createNewReleaseBranch
131
-
132
132
fi
133
133
}
134
134
@@ -138,14 +138,14 @@ createPullRequest(){
138
138
}
139
139
140
140
main (){
141
- # checkoutToReleaseBranch
142
- # updateVersionNumbers
143
- # exportEnvironmentVariables
144
- # make bundle
145
- # commitChanges "chore(release): release version ${SCHEMA_VERSION}"
146
- # createPullRequest "v${SCHEMA_VERSION} Release"
147
- # Check if the branch exists in the remote repository
141
+ checkoutToReleaseBranch
142
+ updateVersionNumbers
143
+ exportEnvironmentVariables
144
+ make bundle
145
+ commitChanges " chore(release): release version ${SCHEMA_VERSION} "
148
146
verifyReleaseBranch
147
+ createPullRequest " v${SCHEMA_VERSION} Release"
148
+
149
149
# setUpstream -- LEAVE COMMENTED AS THIS WILL SET MY ORIGIN TO DEVFILE
150
150
}
151
151
0 commit comments