Skip to content

Commit

Permalink
change snapshot to next for dev versioning (#22508)
Browse files Browse the repository at this point in the history
Signed-off-by: Mykhailo Kuznietsov <[email protected]>
  • Loading branch information
mkuznyetsov authored Sep 19, 2023
1 parent 8a0bacc commit 74f1046
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 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
20 changes: 11 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,12 @@ 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
npm run prettier
popd >/dev/null || exit

COMMIT_MSG="chore: Bump to ${NEXT_VERSION} in ${BUMP_BRANCH}"
Expand Down Expand Up @@ -160,6 +163,7 @@ pushd tests/e2e >/dev/null || exit
jq ".\"dependencies\".\"@eclipse-che/che-devworkspace-generator\" = \"${VERSION}\"" package.json > package.json.update
mv package.json.update package.json
npm --no-git-tag-version version --allow-same-version "${VERSION}"
npm run prettier
popd >/dev/null || exit

docker build -t quay.io/eclipse/che-e2e:${VERSION} -f tests/e2e/build/dockerfiles/Dockerfile tests/e2e
Expand All @@ -177,9 +181,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 +191,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
2 changes: 1 addition & 1 deletion tests/e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eclipse-che/che-e2e",
"version": "7.73.0-SNAPSHOT",
"version": "7.75.0-next",
"description": "",
"main": "dist/index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ suite(`"Start workspace with existed workspace name" test`, function (): void {
existedWorkspaceName = WorkspaceHandlingTests.getWorkspaceName();
await workspaceHandlingTests.stopWorkspace(existedWorkspaceName);
await browserTabsUtil.closeAllTabsExceptCurrent();
});
});

test(`Create new workspace from the same ${stackName} stack`, async function (): Promise<void> {
existedWorkspaceName = WorkspaceHandlingTests.getWorkspaceName();
Expand Down

0 comments on commit 74f1046

Please sign in to comment.