Skip to content

Commit

Permalink
Hacks to increment patch version
Browse files Browse the repository at this point in the history
Signed-off-by: Ali Ok <[email protected]>
  • Loading branch information
aliok committed May 9, 2024
1 parent 05f1c68 commit 7e684ca
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/release-plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,21 @@ jobs:
## e.g. release-1.33 -> 1.33
BASE_RELEASE_VERSION=${SO_RELEASE_NAME#*-}
echo "BASE_RELEASE_VERSION: ${BASE_RELEASE_VERSION}"
DATE_TIME=$(date +"%Y%m%d%H%M%S")
RELEASE_NAME="${BASE_RELEASE_VERSION}.0-${DATE_TIME}"
RELEASE_NAME="${BASE_RELEASE_VERSION}.0"
# get the patch release versions for the BASE_RELEASE_VERSION
# if there's one already, increase its number by 1
PATCH_RELEASES=$(npm view @openshift-knative/plugin-knative-event-mesh-backend versions --json | grep ${BASE_RELEASE_VERSION})
echo "Existing PATCH_RELEASES: ${PATCH_RELEASES}"
if [ -z "${PATCH_RELEASES}" ]; then
echo "No existing PATCH_RELEASES found for ${BASE_RELEASE_VERSION}"
else
echo "Existing PATCH_RELEASES found for ${BASE_RELEASE_VERSION}"
PATCH=$(echo "${PATCH_RELEASES}" | tail -1 | tr -d '"' | awk -F \. '{print $3+1}')
RELEASE_NAME="${BASE_RELEASE_VERSION}.${PATCH}"
fi
echo "RELEASE_NAME: ${RELEASE_NAME}"
echo "RELEASE_NAME=${RELEASE_NAME}" >> $GITHUB_ENV
Expand Down

0 comments on commit 7e684ca

Please sign in to comment.