Skip to content

Commit

Permalink
fix: cd down two dirs, but only cd back one:... (eclipse-che#20868)
Browse files Browse the repository at this point in the history
* fix: cd down two dirs, but only cd back one: better to use pushd and popd anyway

Change-Id: I856425d745336d8e4d9d8f9cf8fa7a6a8dae581a
Signed-off-by: nickboldt <nboldt@redhat.com>

* fix: also reorder steps: must commit before tagging and pushing

Change-Id: Id56e13f39d09b76c74fef06fa22aa65b8565dfbd
Signed-off-by: nickboldt <nboldt@redhat.com>

* fix: fix tag checking condition

Signed-off-by: Mykhailo Kuznietsov <mkuznets@redhat.com>

* fix: remove direct git add commands, as it is include in commit commant

Signed-off-by: Mykhailo Kuznietsov <mkuznets@redhat.com>

* fix: fix tag removal

Signed-off-by: Mykhailo Kuznietsov <mkuznets@redhat.com>

Co-authored-by: Mykhailo Kuznietsov <mkuznets@redhat.com>
  • Loading branch information
nickboldt and mkuznyetsov authored Dec 2, 2021
1 parent e7d97dc commit 0d5deb3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
fetch-depth: 0
-
name: Check existing tags
if: github.event.inputs.forceRecreateTags == 'true'
run: |
set +e
RECREATE_TAGS=${{ github.event.inputs.forceRecreateTags }}
Expand All @@ -42,6 +41,7 @@ jobs:
if [[ ${RECREATE_TAGS} == "true" ]]; then
echo "[INFO] Removing tag for ${VERSION} version. New tag will be recreated during release."
git push origin :$VERSION
git tag -d || true
else
echo "[ERROR] Cannot proceed with release - tag ${EXISTING_TAG} already exists."
exit 1
Expand Down
16 changes: 8 additions & 8 deletions make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ bump_version () {
echo "Updating project version to ${NEXT_VERSION}"
echo "${NEXT_VERSION}" > VERSION

cd tests/e2e
pushd tests/e2e >/dev/null || exit
npm --no-git-tag-version version --allow-same-version "${NEXT_VERSION}"
sed_in_place -r -e "/@eclipse-che\/api|@eclipse-che\/workspace-client|@eclipse-che\/workspace-telemetry-client/!s/(\"@eclipse-che\/..*\": )(\".*\")/\1\"$VERSION\"/" package.json
cd ..
git add VERSION package.json
popd >/dev/null || exit

COMMIT_MSG="chore: Bump to ${NEXT_VERSION} in ${BUMP_BRANCH}"
git commit -asm "${COMMIT_MSG}"
git pull origin "${BUMP_BRANCH}"
Expand Down Expand Up @@ -152,12 +152,11 @@ set -e

# change VERSION file
echo "${VERSION}" > VERSION
git add VERSION

cd tests/e2e
pushd tests/e2e >/dev/null || exit
sed_in_place -r -e "/@eclipse-che\/api|@eclipse-che\/workspace-client|@eclipse-che\/workspace-telemetry-client/!s/(\"@eclipse-che\/..*\": )(\".*\")/\1\"$VERSION\"/" package.json
npm --no-git-tag-version version --allow-same-version "${VERSION}"
cd ../..
popd >/dev/null || exit

echo "Copying source code to dockerfile directory"
cp -r "tests/e2e" "dockerfiles/e2e/e2e"
Expand All @@ -170,11 +169,12 @@ docker push quay.io/eclipse/che-e2e:latest
# update template in the release tag
update_issue_template "${VERSION}" "${ISSUE_TEMPLATE_FILE}"

COMMIT_MSG="chore: Release ${VERSION}"
git commit -asm "${COMMIT_MSG}"

# tag the release
git tag "${VERSION}"
git push origin "${VERSION}"
COMMIT_MSG="chore: Release ${VERSION}"
git commit -asm "${COMMIT_MSG}"

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

0 comments on commit 0d5deb3

Please sign in to comment.