Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
fix: fixes to devworkspace generator release (#778)
Browse files Browse the repository at this point in the history
Signed-off-by: Mykhailo Kuznietsov <mkuznets@redhat.com>
  • Loading branch information
mkuznyetsov authored Sep 11, 2023
1 parent 2be6a3a commit c0a33f9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/devworkspace-generator-publish-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
push:
branches:
- main
- 7.**.x
paths:
- 'tools/devworkspace-generator/**'
- '.github/workflows/devworkspace-generator-publish-next.yml'
Expand Down Expand Up @@ -41,6 +42,14 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
if [[ ${GITHUB_REF##*/} == "7."**".x" ]]; then
echo "[INFO] using ${GITHUB_REF##*/} tag"
DIST_TAG="${GITHUB_REF##*/}-next"
else
echo "[INFO] using "next" tag"
DIST_TAG=next
fi
cd tools/devworkspace-generator
yarn
yarn compile
Expand All @@ -49,4 +58,4 @@ jobs:
NEW_VERSION="${CURRENT_VERSION}-${SHORT_SHA1}"
echo New version is ${NEW_VERSION}
sed -i -r -e "s/(\"version\": )(\".*\")/\1\"$NEW_VERSION\"/" package.json
npm publish --tag next
npm publish --tag $DIST_TAG
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ git tag 7.8.0
git push origin 7.8.0
```

After the release, the `VERSION` file should be bumped in the main branch, e.g. to `7.9.0-SNAPSHOT`.
After the release, the `VERSION` file should be bumped in the main branch, e.g. to `7.75.0-next`.

## Service / Bugfix Release

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.74.0-SNAPSHOT
7.75.0-next
2 changes: 1 addition & 1 deletion build/scripts/generate_devworkspace_templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
set -e

VERSION="${1%/}"
if [[ -z "$VERSION" || "$VERSION" == *"-SNAPSHOT" ]]; then
if [[ -z "$VERSION" || "$VERSION" == *"-next" ]]; then
VERSION="main"
fi

Expand Down
6 changes: 3 additions & 3 deletions make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,18 @@ if [[ $TRIGGER_RELEASE -eq 1 ]]; then
git push origin "${VERSION}"
fi

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

# change VERSION file + commit change into ${BASEBRANCH} branch
if [[ "${BASEBRANCH}" != "${BRANCH}" ]]; then
# bump the y digit
[[ $BRANCH =~ ^([0-9]+)\.([0-9]+)\.x ]] && BASE=${BASH_REMATCH[1]}; NEXT=${BASH_REMATCH[2]}; (( NEXT=NEXT+1 )) # for BRANCH=7.10.x, get BASE=7, NEXT=11
NEXTVERSION="${BASE}.${NEXT}.0-SNAPSHOT"
NEXTVERSION="${BASE}.${NEXT}.0-next"
else
# bump the z digit
[[ $VERSION =~ ^([0-9]+)\.([0-9]+)\.([0-9]+) ]] && BASE="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"; NEXT="${BASH_REMATCH[3]}"; (( NEXT=NEXT+1 )) # for VERSION=7.7.1, get BASE=7.7, NEXT=2
NEXTVERSION="${BASE}.${NEXT}-SNAPSHOT"
NEXTVERSION="${BASE}.${NEXT}-next"
fi

# bump VERSION file to NEXTVERSION
Expand Down

0 comments on commit c0a33f9

Please sign in to comment.