diff --git a/.github/workflows/hexabot-npm.yml b/.github/workflows/hexabot-npm.yml index 7860372a..e7d16237 100644 --- a/.github/workflows/hexabot-npm.yml +++ b/.github/workflows/hexabot-npm.yml @@ -55,9 +55,4 @@ jobs: - name: Publish to npm if: env.release != 'none' - run: | - if [[ "$release" == "patch" ]]; then - npm run release:patch - elif [[ "$release" == "minor" ]]; then - npm run release:minor - fi + run: npm publish diff --git a/bump-version.sh b/bump-version.sh new file mode 100755 index 00000000..194a0085 --- /dev/null +++ b/bump-version.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# Ensure script exits on any command failure +set -e + +# Check if a release type argument is provided +if [ -z "$1" ]; then + echo "Usage: $0 " + echo "release-type: patch | minor" + exit 1 +fi + +RELEASE_TYPE=$1 +ROOT_DIR=$(pwd) + +if [[ "$RELEASE_TYPE" != "patch" && "$RELEASE_TYPE" != "minor" ]]; then + echo "Invalid release type. Use 'patch' or 'minor'." + exit 1 +fi + +echo "Executing release: $RELEASE_TYPE" + +# Execute the appropriate npm release command +if [[ "$RELEASE_TYPE" == "patch" ]]; then + npm run release:patch +elif [[ "$RELEASE_TYPE" == "minor" ]]; then + npm run release:minor +fi + +# Retrieve the new version from package.json +NEW_VERSION=$(jq -r '.version' "$ROOT_DIR/package.json") + +if [ -z "$NEW_VERSION" ]; then + echo "Failed to retrieve the version from package.json." + exit 1 +fi + + +# Commit and push changes +echo "Committing and pushing changes..." +git add . +git commit -m "build: v$NEW_VERSION" + +# Add git tag +echo "Tagging version v$NEW_VERSION" +git tag "v$NEW_VERSION" +git push origin main --tags + +echo "Release ($RELEASE_TYPE) completed successfully." diff --git a/frontend/.dockerignore b/frontend/.dockerignore index b6b7a04f..6b9e549c 100644 --- a/frontend/.dockerignore +++ b/frontend/.dockerignore @@ -11,3 +11,4 @@ LICENSE .next *.swp /scripts +*.sh diff --git a/package-lock.json b/package-lock.json index b4d808c9..fd9dbbdb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "hexabot", - "version": "2.0.0", + "version": "2.0.17", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "hexabot", - "version": "2.0.0", + "version": "2.0.17", "license": "AGPL-3.0-only", "workspaces": [ "frontend", @@ -45,7 +45,7 @@ }, "frontend": { "name": "hexabot-ui", - "version": "2.0.0", + "version": "2.0.18", "license": "AGPL-3.0-only", "dependencies": { "@chatscope/chat-ui-kit-react": "^2.0.3", @@ -9771,7 +9771,7 @@ }, "widget": { "name": "hexabot-chat-widget", - "version": "2.0.3", + "version": "2.0.18", "license": "AGPL-3.0-only", "dependencies": { "@types/emoji-js": "^3.5.2", diff --git a/package.json b/package.json index 8ecdaefb..46cefdfa 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "dev:widget": "npm run dev --workspace=widget", "release:api:patch": "cd api/ && npm version --git-tag-version false --commit-hooks false patch", "release:api:minor": "cd api/ && npm version --git-tag-version false --commit-hooks false minor", - "release:patch": "npm run release:api:patch && npm version patch --workspaces && git push origin main --tags", - "release:minor": "npm run release:api:minor && npm version minor --workspaces && git push origin main --tags" + "release:patch": "npm run release:api:patch && npm version --git-tag-version false --commit-hooks false --workspaces patch", + "release:minor": "npm run release:api:minor && npm version --git-tag-version false --commit-hooks false --workspaces minor" }, "devDependencies": { "@commitlint/cli": "^19.3.0",