From 883b89ccfd26d6786db3be07dda6eeebf87677da Mon Sep 17 00:00:00 2001 From: haoyan Date: Tue, 23 Sep 2025 16:41:04 -0400 Subject: [PATCH 01/13] update version bump strategy --- .github/workflows/deploy-alpha.yml | 62 +++++++++++++++++++++++++++++- .github/workflows/deploy.yml | 40 +++++++++++-------- 2 files changed, 84 insertions(+), 18 deletions(-) diff --git a/.github/workflows/deploy-alpha.yml b/.github/workflows/deploy-alpha.yml index 1fb3eef..9eefe0f 100644 --- a/.github/workflows/deploy-alpha.yml +++ b/.github/workflows/deploy-alpha.yml @@ -61,7 +61,7 @@ jobs: - name: Run linter run: npm run lint - deploy-alpha: + check-and-bump-version: needs: lint runs-on: ubuntu-latest if: github.event.pull_request.head.repo.full_name == github.repository @@ -79,6 +79,66 @@ jobs: cache: "npm" - name: Install dependencies run: npm ci --legacy-peer-deps + - name: Check and bump version if needed + run: | + # Get current version from package.json + CURRENT_VERSION=$(node -p "require('./package.json').version") + echo "Current version: ${CURRENT_VERSION}" + + # Get latest stable NPM version (excluding alpha/beta) + LATEST_NPM_VERSION=$(npm view react-jsonschema-form-extras dist-tags.latest 2>/dev/null || echo "0.0.0") + echo "Latest NPM version: ${LATEST_NPM_VERSION}" + + # Clean current version (remove any prerelease suffix) + CLEAN_CURRENT_VERSION=$(echo "${CURRENT_VERSION}" | sed 's/-.*$//') + echo "Clean version: ${CLEAN_CURRENT_VERSION}" + + # Check if version bump is needed using semver + npm install --no-save semver + NEEDS_BUMP=$(node -e "const semver = require('semver'); console.log(semver.lte('${CLEAN_CURRENT_VERSION}', '${LATEST_NPM_VERSION}'))") + + if [ "${NEEDS_BUMP}" = "true" ]; then + echo "📦 Version bump needed" + + # Reset to clean version if it has prerelease suffix + if [[ "${CURRENT_VERSION}" != "${CLEAN_CURRENT_VERSION}" ]]; then + npm version "${CLEAN_CURRENT_VERSION}" --no-git-tag-version + fi + + # Bump patch version + NEW_VERSION=$(npm version patch --no-git-tag-version) + echo "🚀 Bumped to: ${NEW_VERSION}" + + # Commit to PR branch + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add package.json package-lock.json + git commit -m "🔖 Bump version to ${NEW_VERSION}" + git push origin ${{ github.event.pull_request.head.ref }} + + echo "✅ Version bumped and committed" + else + echo "✅ Version is already newer than NPM" + fi + + deploy-alpha: + needs: check-and-bump-version + runs-on: ubuntu-latest + if: github.event.pull_request.head.repo.full_name == github.repository + steps: + - name: Checkout code (after version bump) + uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_ACTIONS_TOKEN }} + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.ref }} + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + - name: Install dependencies + run: npm ci --legacy-peer-deps - name: Build project run: npm run dist - name: Validate build output diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9e8a532..1bd5f94 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,6 +1,9 @@ name: Deploy to NPM on: + push: + branches: + - master workflow_dispatch: jobs: @@ -33,11 +36,24 @@ jobs: exit 1 fi echo "✅ Build output validated (lib and dist folders created)" - - name: Bump version - id: bump_version + - name: Get current version + id: get_version run: | - NEW_VERSION=$(npm version patch --no-git-tag-version) - echo "new_version=${NEW_VERSION}" >> $GITHUB_ENV + CURRENT_VERSION=$(node -p "require('./package.json').version") + echo "current_version=${CURRENT_VERSION}" >> $GITHUB_ENV + echo "📦 Publishing version: ${CURRENT_VERSION}" + - name: Check if version exists on NPM + id: check_npm + run: | + CURRENT_VERSION="${{ env.current_version }}" + if npm view react-jsonschema-form-extras@${CURRENT_VERSION} version 2>/dev/null; then + echo "❌ Version ${CURRENT_VERSION} already exists on NPM" + echo "version_exists=true" >> $GITHUB_ENV + exit 1 + else + echo "✅ Version ${CURRENT_VERSION} is new, proceeding with publication" + echo "version_exists=false" >> $GITHUB_ENV + fi - name: Authenticate with NPM env: NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} @@ -45,22 +61,12 @@ jobs: - name: Publish Release Version run: | npm publish - echo "✅ Successfully published to NPM" + echo "✅ Successfully published version ${{ env.current_version }} to NPM" env: NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} - - name: Commit and push version bump - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add package.json package-lock.json - git commit -m "[skip actions] bump to version ${new_version}" - git push origin master - env: - GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }} - new_version: ${{ env.new_version }} - name: Create GitHub Release env: GH_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }} - new_version: ${{ env.new_version }} + current_version: ${{ env.current_version }} run: | - gh release create "${new_version}" --generate-notes --latest --target master + gh release create "${{ env.current_version }}" --generate-notes --latest --target master From 54d95abaabf8da832f7d46efafe32fc149787bd0 Mon Sep 17 00:00:00 2001 From: haoyan Date: Tue, 23 Sep 2025 16:45:32 -0400 Subject: [PATCH 02/13] update version comparison --- .github/workflows/deploy-alpha.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-alpha.yml b/.github/workflows/deploy-alpha.yml index 9eefe0f..375b105 100644 --- a/.github/workflows/deploy-alpha.yml +++ b/.github/workflows/deploy-alpha.yml @@ -93,9 +93,23 @@ jobs: CLEAN_CURRENT_VERSION=$(echo "${CURRENT_VERSION}" | sed 's/-.*$//') echo "Clean version: ${CLEAN_CURRENT_VERSION}" - # Check if version bump is needed using semver - npm install --no-save semver - NEEDS_BUMP=$(node -e "const semver = require('semver'); console.log(semver.lte('${CLEAN_CURRENT_VERSION}', '${LATEST_NPM_VERSION}'))") + # Check if version bump is needed using Node.js built-in comparison + NEEDS_BUMP=$(node -e " + const current = '${CLEAN_CURRENT_VERSION}'.split('.').map(Number); + const npm = '${LATEST_NPM_VERSION}'.split('.').map(Number); + + // Compare major.minor.patch + for (let i = 0; i < 3; i++) { + if (current[i] < npm[i]) { + console.log('true'); // need bump + process.exit(0); + } else if (current[i] > npm[i]) { + console.log('false'); // no bump + process.exit(0); + } + } + console.log('true'); // versions are equal, need bump + ") if [ "${NEEDS_BUMP}" = "true" ]; then echo "📦 Version bump needed" From 99f097aedd25f483098fe3060f91aa7406371869 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 23 Sep 2025 20:46:50 +0000 Subject: [PATCH 03/13] =?UTF-8?q?=F0=9F=94=96=20Bump=20version=20to=20v1.1?= =?UTF-8?q?.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index cba2fec..4a891e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-jsonschema-form-extras", - "version": "1.0.1", + "version": "1.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "react-jsonschema-form-extras", - "version": "1.0.1", + "version": "1.1.1", "license": "Apache-2.0", "dependencies": { "@emotion/react": "^11.11.0", diff --git a/package.json b/package.json index 787ccd1..ab52698 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Extra widgets for Mozilla's react-jsonschema-form", "private": false, "author": "mavarazy@gmail.com", - "version": "1.1.0", + "version": "1.1.1", "scripts": { "build:lib": "rimraf lib && cross-env NODE_ENV=production babel -d lib/ src/ --copy-files", "build:dist": "rimraf dist && cross-env NODE_ENV=production webpack --config webpack.config.dist.js", From cb54933790ea39b76e145affdb8bd9ddaa27d798 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 23 Sep 2025 20:48:12 +0000 Subject: [PATCH 04/13] =?UTF-8?q?=F0=9F=94=96=20Bump=20version=20to=20v1.1?= =?UTF-8?q?.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4a891e8..eb05d20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-jsonschema-form-extras", - "version": "1.1.1", + "version": "1.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "react-jsonschema-form-extras", - "version": "1.1.1", + "version": "1.1.2", "license": "Apache-2.0", "dependencies": { "@emotion/react": "^11.11.0", diff --git a/package.json b/package.json index ab52698..b1b91c2 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Extra widgets for Mozilla's react-jsonschema-form", "private": false, "author": "mavarazy@gmail.com", - "version": "1.1.1", + "version": "1.1.2", "scripts": { "build:lib": "rimraf lib && cross-env NODE_ENV=production babel -d lib/ src/ --copy-files", "build:dist": "rimraf dist && cross-env NODE_ENV=production webpack --config webpack.config.dist.js", From b8e248a0a71ce105635276986924fa2e0b171dcb Mon Sep 17 00:00:00 2001 From: haoyan Date: Tue, 23 Sep 2025 16:54:52 -0400 Subject: [PATCH 05/13] update version bump strategy --- .github/workflows/deploy-alpha.yml | 53 +++++++++++++++--------------- package.json | 2 +- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/.github/workflows/deploy-alpha.yml b/.github/workflows/deploy-alpha.yml index 375b105..8cfdf55 100644 --- a/.github/workflows/deploy-alpha.yml +++ b/.github/workflows/deploy-alpha.yml @@ -93,46 +93,45 @@ jobs: CLEAN_CURRENT_VERSION=$(echo "${CURRENT_VERSION}" | sed 's/-.*$//') echo "Clean version: ${CLEAN_CURRENT_VERSION}" - # Check if version bump is needed using Node.js built-in comparison - NEEDS_BUMP=$(node -e " - const current = '${CLEAN_CURRENT_VERSION}'.split('.').map(Number); - const npm = '${LATEST_NPM_VERSION}'.split('.').map(Number); + # Calculate next version after NPM version + NEXT_VERSION=$(node -e " + const current = '${CLEAN_CURRENT_VERSION}'; + const npm = '${LATEST_NPM_VERSION}'; - // Compare major.minor.patch - for (let i = 0; i < 3; i++) { - if (current[i] < npm[i]) { - console.log('true'); // need bump - process.exit(0); - } else if (current[i] > npm[i]) { - console.log('false'); // no bump - process.exit(0); - } + const currentParts = current.split('.').map(Number); + const npmParts = npm.split('.').map(Number); + + // Check if current is greater than npm + const isGreater = currentParts[0] > npmParts[0] || + (currentParts[0] === npmParts[0] && currentParts[1] > npmParts[1]) || + (currentParts[0] === npmParts[0] && currentParts[1] === npmParts[1] && currentParts[2] > npmParts[2]); + + if (isGreater) { + console.log('no-bump'); + } else { + // Calculate next patch version after NPM + const nextVersion = npmParts[0] + '.' + npmParts[1] + '.' + (npmParts[2] + 1); + console.log(nextVersion); } - console.log('true'); // versions are equal, need bump ") - if [ "${NEEDS_BUMP}" = "true" ]; then - echo "📦 Version bump needed" - - # Reset to clean version if it has prerelease suffix - if [[ "${CURRENT_VERSION}" != "${CLEAN_CURRENT_VERSION}" ]]; then - npm version "${CLEAN_CURRENT_VERSION}" --no-git-tag-version - fi + if [ "${NEXT_VERSION}" = "no-bump" ]; then + echo "✅ Current version is already newer than NPM" + else + echo "📦 Version bump needed to: ${NEXT_VERSION}" - # Bump patch version - NEW_VERSION=$(npm version patch --no-git-tag-version) - echo "🚀 Bumped to: ${NEW_VERSION}" + # Set the exact next version + npm version "${NEXT_VERSION}" --no-git-tag-version + echo "🚀 Bumped to: ${NEXT_VERSION}" # Commit to PR branch git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add package.json package-lock.json - git commit -m "🔖 Bump version to ${NEW_VERSION}" + git commit -m "[skip ci] 🔖 Bump version to ${NEXT_VERSION}" git push origin ${{ github.event.pull_request.head.ref }} echo "✅ Version bumped and committed" - else - echo "✅ Version is already newer than NPM" fi deploy-alpha: diff --git a/package.json b/package.json index b1b91c2..787ccd1 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Extra widgets for Mozilla's react-jsonschema-form", "private": false, "author": "mavarazy@gmail.com", - "version": "1.1.2", + "version": "1.1.0", "scripts": { "build:lib": "rimraf lib && cross-env NODE_ENV=production babel -d lib/ src/ --copy-files", "build:dist": "rimraf dist && cross-env NODE_ENV=production webpack --config webpack.config.dist.js", From aa74d2c68ddd56fe45938aaef919a06d1486e5e1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 23 Sep 2025 20:55:58 +0000 Subject: [PATCH 06/13] =?UTF-8?q?[skip=20ci]=20=F0=9F=94=96=20Bump=20versi?= =?UTF-8?q?on=20to=201.1.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 787ccd1..b1b91c2 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Extra widgets for Mozilla's react-jsonschema-form", "private": false, "author": "mavarazy@gmail.com", - "version": "1.1.0", + "version": "1.1.2", "scripts": { "build:lib": "rimraf lib && cross-env NODE_ENV=production babel -d lib/ src/ --copy-files", "build:dist": "rimraf dist && cross-env NODE_ENV=production webpack --config webpack.config.dist.js", From cc0b8be995df1c69813924514509224ab2ea178c Mon Sep 17 00:00:00 2001 From: haoyan Date: Tue, 23 Sep 2025 16:58:17 -0400 Subject: [PATCH 07/13] test version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b1b91c2..787ccd1 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Extra widgets for Mozilla's react-jsonschema-form", "private": false, "author": "mavarazy@gmail.com", - "version": "1.1.2", + "version": "1.1.0", "scripts": { "build:lib": "rimraf lib && cross-env NODE_ENV=production babel -d lib/ src/ --copy-files", "build:dist": "rimraf dist && cross-env NODE_ENV=production webpack --config webpack.config.dist.js", From 1b5774a7fb2312a24c2e87c6c41620e53e48220d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 23 Sep 2025 20:59:29 +0000 Subject: [PATCH 08/13] =?UTF-8?q?[skip=20ci]=20=F0=9F=94=96=20Bump=20versi?= =?UTF-8?q?on=20to=201.1.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 787ccd1..b1b91c2 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Extra widgets for Mozilla's react-jsonschema-form", "private": false, "author": "mavarazy@gmail.com", - "version": "1.1.0", + "version": "1.1.2", "scripts": { "build:lib": "rimraf lib && cross-env NODE_ENV=production babel -d lib/ src/ --copy-files", "build:dist": "rimraf dist && cross-env NODE_ENV=production webpack --config webpack.config.dist.js", From 96a559bd15d38c9751516d756fee19f9802a78b5 Mon Sep 17 00:00:00 2001 From: haoyan Date: Tue, 23 Sep 2025 17:11:10 -0400 Subject: [PATCH 09/13] fix version check --- .github/workflows/deploy-alpha.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy-alpha.yml b/.github/workflows/deploy-alpha.yml index 8cfdf55..533f072 100644 --- a/.github/workflows/deploy-alpha.yml +++ b/.github/workflows/deploy-alpha.yml @@ -85,9 +85,9 @@ jobs: CURRENT_VERSION=$(node -p "require('./package.json').version") echo "Current version: ${CURRENT_VERSION}" - # Get latest stable NPM version (excluding alpha/beta) - LATEST_NPM_VERSION=$(npm view react-jsonschema-form-extras dist-tags.latest 2>/dev/null || echo "0.0.0") - echo "Latest NPM version: ${LATEST_NPM_VERSION}" + # Get latest stable NPM version (excluding alpha/beta/prerelease) + LATEST_NPM_VERSION=$(npm view react-jsonschema-form-extras versions --json | jq -r '.[]' | grep -v '\-' | tail -1 2>/dev/null || echo "0.0.0") + echo "Latest stable NPM version: ${LATEST_NPM_VERSION}" # Clean current version (remove any prerelease suffix) CLEAN_CURRENT_VERSION=$(echo "${CURRENT_VERSION}" | sed 's/-.*$//') @@ -98,19 +98,26 @@ jobs: const current = '${CLEAN_CURRENT_VERSION}'; const npm = '${LATEST_NPM_VERSION}'; + // Validate that npm version is a proper semver (not empty or invalid) + const npmParts = npm.split('.'); + if (npmParts.length !== 3 || npmParts.some(part => isNaN(Number(part)))) { + console.log('no-bump'); + return; + } + const currentParts = current.split('.').map(Number); - const npmParts = npm.split('.').map(Number); + const npmPartsNum = npmParts.map(Number); // Check if current is greater than npm - const isGreater = currentParts[0] > npmParts[0] || - (currentParts[0] === npmParts[0] && currentParts[1] > npmParts[1]) || - (currentParts[0] === npmParts[0] && currentParts[1] === npmParts[1] && currentParts[2] > npmParts[2]); + const isGreater = currentParts[0] > npmPartsNum[0] || + (currentParts[0] === npmPartsNum[0] && currentParts[1] > npmPartsNum[1]) || + (currentParts[0] === npmPartsNum[0] && currentParts[1] === npmPartsNum[1] && currentParts[2] > npmPartsNum[2]); if (isGreater) { console.log('no-bump'); } else { // Calculate next patch version after NPM - const nextVersion = npmParts[0] + '.' + npmParts[1] + '.' + (npmParts[2] + 1); + const nextVersion = npmPartsNum[0] + '.' + npmPartsNum[1] + '.' + (npmPartsNum[2] + 1); console.log(nextVersion); } ") From d6cbeae51246d29938d03d2609363dd0f37b2f76 Mon Sep 17 00:00:00 2001 From: haoyan Date: Tue, 23 Sep 2025 17:14:36 -0400 Subject: [PATCH 10/13] update version calculation --- .github/workflows/deploy-alpha.yml | 68 ++++++++++++++---------------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/.github/workflows/deploy-alpha.yml b/.github/workflows/deploy-alpha.yml index 533f072..d57b8dd 100644 --- a/.github/workflows/deploy-alpha.yml +++ b/.github/workflows/deploy-alpha.yml @@ -85,60 +85,54 @@ jobs: CURRENT_VERSION=$(node -p "require('./package.json').version") echo "Current version: ${CURRENT_VERSION}" - # Get latest stable NPM version (excluding alpha/beta/prerelease) - LATEST_NPM_VERSION=$(npm view react-jsonschema-form-extras versions --json | jq -r '.[]' | grep -v '\-' | tail -1 2>/dev/null || echo "0.0.0") - echo "Latest stable NPM version: ${LATEST_NPM_VERSION}" + # Get latest version from NPM (just the latest published version) + LATEST_NPM_VERSION=$(npm view react-jsonschema-form-extras version 2>/dev/null || echo "0.0.0") + echo "Latest NPM version: ${LATEST_NPM_VERSION}" + + # Extract clean version from NPM version (remove prerelease suffix) + CLEAN_NPM_VERSION=$(echo "${LATEST_NPM_VERSION}" | sed 's/-.*$//') + echo "Clean NPM version: ${CLEAN_NPM_VERSION}" # Clean current version (remove any prerelease suffix) CLEAN_CURRENT_VERSION=$(echo "${CURRENT_VERSION}" | sed 's/-.*$//') - echo "Clean version: ${CLEAN_CURRENT_VERSION}" + echo "Clean current version: ${CLEAN_CURRENT_VERSION}" - # Calculate next version after NPM version - NEXT_VERSION=$(node -e " - const current = '${CLEAN_CURRENT_VERSION}'; - const npm = '${LATEST_NPM_VERSION}'; - - // Validate that npm version is a proper semver (not empty or invalid) - const npmParts = npm.split('.'); - if (npmParts.length !== 3 || npmParts.some(part => isNaN(Number(part)))) { - console.log('no-bump'); - return; - } - - const currentParts = current.split('.').map(Number); - const npmPartsNum = npmParts.map(Number); - - // Check if current is greater than npm - const isGreater = currentParts[0] > npmPartsNum[0] || - (currentParts[0] === npmPartsNum[0] && currentParts[1] > npmPartsNum[1]) || - (currentParts[0] === npmPartsNum[0] && currentParts[1] === npmPartsNum[1] && currentParts[2] > npmPartsNum[2]); + # Simple version comparison using Node.js + SHOULD_BUMP=$(node -e " + const current = '${CLEAN_CURRENT_VERSION}'.split('.').map(Number); + const npm = '${CLEAN_NPM_VERSION}'.split('.').map(Number); - if (isGreater) { - console.log('no-bump'); - } else { - // Calculate next patch version after NPM - const nextVersion = npmPartsNum[0] + '.' + npmPartsNum[1] + '.' + (npmPartsNum[2] + 1); - console.log(nextVersion); + // Compare versions: if current <= npm, need bump + for (let i = 0; i < 3; i++) { + if (current[i] < npm[i]) { + console.log('true'); + process.exit(0); + } else if (current[i] > npm[i]) { + console.log('false'); + process.exit(0); + } } + // Equal versions = need bump + console.log('true'); ") - if [ "${NEXT_VERSION}" = "no-bump" ]; then - echo "✅ Current version is already newer than NPM" - else - echo "📦 Version bump needed to: ${NEXT_VERSION}" + if [ "${SHOULD_BUMP}" = "true" ]; then + echo "📦 Version bump needed" - # Set the exact next version - npm version "${NEXT_VERSION}" --no-git-tag-version - echo "🚀 Bumped to: ${NEXT_VERSION}" + # Simple patch bump + NEW_VERSION=$(npm version patch --no-git-tag-version) + echo "🚀 Bumped to: ${NEW_VERSION}" # Commit to PR branch git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add package.json package-lock.json - git commit -m "[skip ci] 🔖 Bump version to ${NEXT_VERSION}" + git commit -m "[skip ci] 🔖 Bump version to ${NEW_VERSION}" git push origin ${{ github.event.pull_request.head.ref }} echo "✅ Version bumped and committed" + else + echo "✅ Current version is already newer than NPM" fi deploy-alpha: From 1a4fe3c465667faee6b10e62486ffb12b94d0050 Mon Sep 17 00:00:00 2001 From: haoyan Date: Tue, 23 Sep 2025 17:18:59 -0400 Subject: [PATCH 11/13] test version bump --- .github/workflows/deploy-alpha.yml | 15 +++++++++++---- package.json | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-alpha.yml b/.github/workflows/deploy-alpha.yml index d57b8dd..1333d62 100644 --- a/.github/workflows/deploy-alpha.yml +++ b/.github/workflows/deploy-alpha.yml @@ -119,15 +119,22 @@ jobs: if [ "${SHOULD_BUMP}" = "true" ]; then echo "📦 Version bump needed" - # Simple patch bump - NEW_VERSION=$(npm version patch --no-git-tag-version) - echo "🚀 Bumped to: ${NEW_VERSION}" + # Calculate next version after NPM version + NEXT_VERSION=$(node -e " + const npm = '${CLEAN_NPM_VERSION}'.split('.').map(Number); + const nextVersion = npm[0] + '.' + npm[1] + '.' + (npm[2] + 1); + console.log(nextVersion); + ") + + # Set the specific next version + npm version "${NEXT_VERSION}" --no-git-tag-version + echo "🚀 Bumped to: ${NEXT_VERSION}" # Commit to PR branch git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add package.json package-lock.json - git commit -m "[skip ci] 🔖 Bump version to ${NEW_VERSION}" + git commit -m "[skip ci] 🔖 Bump version to ${NEXT_VERSION}" git push origin ${{ github.event.pull_request.head.ref }} echo "✅ Version bumped and committed" diff --git a/package.json b/package.json index b1b91c2..787ccd1 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Extra widgets for Mozilla's react-jsonschema-form", "private": false, "author": "mavarazy@gmail.com", - "version": "1.1.2", + "version": "1.1.0", "scripts": { "build:lib": "rimraf lib && cross-env NODE_ENV=production babel -d lib/ src/ --copy-files", "build:dist": "rimraf dist && cross-env NODE_ENV=production webpack --config webpack.config.dist.js", From 19bd3d720146c9cd40f465f87d77796da72f9ddb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 23 Sep 2025 21:20:17 +0000 Subject: [PATCH 12/13] =?UTF-8?q?[skip=20ci]=20=F0=9F=94=96=20Bump=20versi?= =?UTF-8?q?on=20to=201.1.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 787ccd1..b1b91c2 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Extra widgets for Mozilla's react-jsonschema-form", "private": false, "author": "mavarazy@gmail.com", - "version": "1.1.0", + "version": "1.1.2", "scripts": { "build:lib": "rimraf lib && cross-env NODE_ENV=production babel -d lib/ src/ --copy-files", "build:dist": "rimraf dist && cross-env NODE_ENV=production webpack --config webpack.config.dist.js", From 92296d4f6a3a144d18faa37066979c91ade83b2f Mon Sep 17 00:00:00 2001 From: haoyan <78907254+yuhaoyann@users.noreply.github.com> Date: Tue, 23 Sep 2025 17:29:32 -0400 Subject: [PATCH 13/13] Disable automatic deploy on master branch push Removed automatic deployment on push to master branch. --- .github/workflows/deploy.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1bd5f94..cc90795 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,9 +1,6 @@ name: Deploy to NPM on: - push: - branches: - - master workflow_dispatch: jobs: