Skip to content

Commit

Permalink
change snapshot to next for dev versioning
Browse files Browse the repository at this point in the history
Signed-off-by: Mykhailo Kuznietsov <[email protected]>
  • Loading branch information
mkuznyetsov committed Sep 12, 2023
1 parent e38c24d commit a03f539
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/typescript-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ jobs:
npm ci && npm run tsc
SHORT_SHA1=$(git rev-parse --short=7 HEAD)
CURRENT_VERSION=$(sed -r 's/(.*)-SNAPSHOT/\1/' ../../VERSION)
NEW_VERSION="${CURRENT_VERSION}-dev-${SHORT_SHA1}"
CURRENT_VERSION=$(sed -r 's/(.*)-next/\1/' ../../VERSION)
NEW_VERSION="${CURRENT_VERSION}-next-${SHORT_SHA1}"
sed -i -r -e "s/(\"version\": )(\".*\")/\1\"$NEW_VERSION\"/" package.json
npm publish --tag $DIST_TAG
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.75.0-SNAPSHOT
7.75.0-next
18 changes: 9 additions & 9 deletions make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ update_issue_template() {
local -r templateFile=$2

# take only two first digits of the version that we will release
# will get 7.35 from input 7.35.0-SNAPSHOT
# will get 7.74 from input 7.74.0-next
local -r versionXY=$(echo "${currentReleaseVersion}" | sed -ne 's/[^0-9]*\(\([0-9]\.\)\{0,4\}[0-9][^.]\).*/\1/p')

# now extract the current latest version specified in the issue template
Expand Down Expand Up @@ -76,9 +76,11 @@ bump_version () {

pushd tests/e2e >/dev/null || exit
npm --no-git-tag-version version --allow-same-version "${NEXT_VERSION}"
# update devworkspace generator version
jq ".\"dependencies\".\"@eclipse-che/che-devworkspace-generator\" = \"${NEXT_VERSION}\"" package.json > package.json.update
mv package.json.update package.json
# update devworkspace generator version only for bugfix releases
if [[ "${BASEBRANCH}" != "${BRANCH}" ]]; then
jq ".\"dependencies\".\"@eclipse-che/che-devworkspace-generator\" = \"${NEXT_VERSION}\"" package.json > package.json.update
mv package.json.update package.json
fi
popd >/dev/null || exit

COMMIT_MSG="chore: Bump to ${NEXT_VERSION} in ${BUMP_BRANCH}"
Expand Down Expand Up @@ -177,9 +179,7 @@ git commit -asm "${COMMIT_MSG}"
git tag "${VERSION}"
git push origin "${VERSION}"



# now update ${BASEBRANCH} to the new snapshot version
# now update ${BASEBRANCH} to the new next version
git checkout "${BASEBRANCH}"

# update template in the branch
Expand All @@ -189,12 +189,12 @@ update_issue_template "${VERSION}" "${ISSUE_TEMPLATE_FILE}"
if [[ "${BASEBRANCH}" != "${BRANCH}" ]]; then
# bump the y digit, if it is a major release
[[ $BRANCH =~ ^([0-9]+)\.([0-9]+)\.x ]] && BASE=${BASH_REMATCH[1]}; NEXT=${BASH_REMATCH[2]}; (( NEXT=NEXT+1 )) # for BRANCH=0.1.x, get BASE=0, NEXT=2
NEXT_VERSION_Y="${BASE}.${NEXT}.0-SNAPSHOT"
NEXT_VERSION_Y="${BASE}.${NEXT}.0-next"
bump_version "${NEXT_VERSION_Y}" "${BASEBRANCH}"
fi
# bump the z digit
[[ ${VERSION#v} =~ ^([0-9]+)\.([0-9]+)\.([0-9]+) ]] && BASE="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"; NEXT="${BASH_REMATCH[3]}"; (( NEXT=NEXT+1 )) # for VERSION=0.1.2, get BASE=0.1, NEXT=3
NEXT_VERSION_Z="${BASE}.${NEXT}-SNAPSHOT"
NEXT_VERSION_Z="${BASE}.${NEXT}-next"
bump_version "${NEXT_VERSION_Z}" "${BRANCH}"

# cleanup tmp dir
Expand Down

0 comments on commit a03f539

Please sign in to comment.