From 02cb070eaa9753df08940003546b9700bf6e7b93 Mon Sep 17 00:00:00 2001 From: alpha2026a Date: Wed, 18 Feb 2026 15:59:04 +0530 Subject: [PATCH 1/6] Create sync-version.yml --- .github/workflows/sync-version.yml | 136 +++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 .github/workflows/sync-version.yml diff --git a/.github/workflows/sync-version.yml b/.github/workflows/sync-version.yml new file mode 100644 index 0000000..8a030b7 --- /dev/null +++ b/.github/workflows/sync-version.yml @@ -0,0 +1,136 @@ +name: Sync Version – Python SDK + +on: + repository_dispatch: + types: [version_update] + +permissions: + contents: write + pull-requests: write + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + # -------------------------------------------- + # Checkout repository + # -------------------------------------------- + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.PAT }} + fetch-depth: 0 + + # -------------------------------------------- + # Load & validate version + # -------------------------------------------- + - name: Load & validate version + run: | + VERSION="${{ github.event.client_payload.version }}" + VERSION="${VERSION//,/\.}" + + if [ -z "$VERSION" ]; then + echo "Version missing in dispatch payload" + exit 1 + fi + + if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then + echo "Invalid version format: $VERSION" + exit 1 + fi + + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "Dispatching version $VERSION" + + # -------------------------------------------- + # Compare current version + # -------------------------------------------- + - name: Compare current version + run: | + CURRENT_VERSION=$(jq -r '.version' bower.json) + + if [ -z "$CURRENT_VERSION" ] || [ "$CURRENT_VERSION" = "null" ]; then + echo "Unable to determine current version from bower.json" + exit 1 + fi + + echo "Current version : $CURRENT_VERSION" + echo "Incoming version: $VERSION" + + if [ "$CURRENT_VERSION" = "$VERSION" ]; then + echo "Versions are identical. Denying PR creation." + exit 0 + fi + + echo "Version change detected. Proceeding." + + # -------------------------------------------- + # Prepare release branch + # -------------------------------------------- + - name: Prepare release branch + run: | + BRANCH="release-v${VERSION}" + echo "BRANCH=$BRANCH" >> $GITHUB_ENV + + git fetch origin + + if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then + git checkout "$BRANCH" + git pull origin "$BRANCH" + else + git checkout -b "$BRANCH" + fi + + # -------------------------------------------- + # Update bower.json version + dependency + # -------------------------------------------- + - name: Update bower.json + run: | + # Update SDK version + jq ".version = \"$VERSION\"" bower.json > tmp.json + mv tmp.json bower.json + + # Update froala-wysiwyg-editor dependency + jq ".dependencies[\"froala-wysiwyg-editor\"] = \"^$VERSION\"" bower.json > tmp.json + mv tmp.json bower.json + + + # -------------------------------------------- + # Commit & push + # -------------------------------------------- + - name: Commit & push + run: | + git config user.name "froala-travis-bot" + git config user.email "froala_git_travis_bot@idera.com" + + git add bower.json + git commit -m "chore: release Python SDK v${VERSION}" || echo "Nothing to commit" + + git push origin "$BRANCH" + + # -------------------------------------------- + # Create Pull Request + # -------------------------------------------- + - name: Create Pull Request + env: + GH_TOKEN: ${{ secrets.PAT }} + RELEASE_NOTES: ${{ github.event.client_payload.release_notes }} + run: | + git fetch origin master + + if git diff --quiet origin/master..."$BRANCH"; then + echo "No commits between $BRANCH and master. Skipping PR creation." + exit 0 + fi + + PR_BODY=$(printf \ + "release: yes\n\n## Release Notes (from primary repo)\n\n%s\n" \ + "$RELEASE_NOTES") + + gh pr create \ + --base master \ + --head "$BRANCH" \ + --title "Release v${VERSION}" \ + --body "$PR_BODY" \ + || echo "Pull request already exists" From 24735190ffd5ff5e5aa399e736aae09b7121136f Mon Sep 17 00:00:00 2001 From: alpha2026a Date: Wed, 18 Feb 2026 16:01:18 +0530 Subject: [PATCH 2/6] Create auto-release.yml --- .github/workflows/auto-release.yml | 98 ++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows/auto-release.yml diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml new file mode 100644 index 0000000..82181a7 --- /dev/null +++ b/.github/workflows/auto-release.yml @@ -0,0 +1,98 @@ +name: Auto Release – WordPress + +on: + pull_request: + types: [closed] + branches: + - master + +permissions: + contents: write + +jobs: + release: + # Run only when PR is merged + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + + steps: + # -------------------------------------------- + # Validate release intent + # -------------------------------------------- + - name: Validate release intent + id: intent + uses: actions/github-script@v6 + with: + script: | + const body = context.payload.pull_request.body || ''; + const title = context.payload.pull_request.title || ''; + const text = `${title}\n${body}`; + + core.setOutput( + 'release', + /release:\s*yes/i.test(text) ? 'true' : 'false' + ); + + - name: Stop if not a release PR + if: steps.intent.outputs.release == 'false' + run: | + echo "Not a release PR. Skipping auto-release." + exit 0 + + # -------------------------------------------- + # Checkout merged code + # -------------------------------------------- + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.PAT }} + fetch-depth: 0 + + # -------------------------------------------- + # Read version from repo (SOURCE OF TRUTH) + # Adjust this if you store version elsewhere + # -------------------------------------------- + - name: Read version from assets + run: | + # Example: extract version from any JS/CSS reference + VERSION=$(grep -RhoE '[0-9]+\.[0-9]+\.[0-9]+' public | head -n1) + + if [ -z "$VERSION" ]; then + echo "Failed to determine version from repository" + exit 1 + fi + + if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then + echo "Invalid version format: $VERSION" + exit 1 + fi + + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "Releasing version $VERSION" + + # -------------------------------------------- + # Prepare clean release notes from PR body + # -------------------------------------------- + - name: Prepare release notes + run: | + PR_BODY="${{ github.event.pull_request.body }}" + + CLEAN_NOTES=$(echo "$PR_BODY" | sed \ + -e '/^release:\s*/Id' \ + -e '/^## Release Notes.*$/Id') + + echo "RELEASE_NOTES<> $GITHUB_ENV + echo "$CLEAN_NOTES" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + # -------------------------------------------- + # Create GitHub Release (NO artifacts) + # -------------------------------------------- + - name: Create GitHub Release + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + run: | + gh release create "v${VERSION}" \ + --title "Release ${VERSION}" \ + --notes "$RELEASE_NOTES" \ + --latest From 955c2ed3d1df8830b75c2f9c60839dd864840e2d Mon Sep 17 00:00:00 2001 From: froala-travis-bot Date: Wed, 18 Feb 2026 10:34:09 +0000 Subject: [PATCH 3/6] chore: release Python SDK v3.0.6 --- bower.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 3fd4e3e..919d99a 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "froala-editor-python-sdk", - "version": "5.0.1", + "version": "3.0.6", "author": "Florin Marius Popescu (https://www.froala.com/)", "description": "Node.js SDK for Froala Editor", "keywords": [ @@ -16,6 +16,6 @@ "bower_components" ], "dependencies": { - "froala-wysiwyg-editor": "^5.0.1" + "froala-wysiwyg-editor": "^3.0.6" } } From c505a444e99910a1aaf9e79ae34c1e8fa6c8501d Mon Sep 17 00:00:00 2001 From: alpha2026a Date: Wed, 18 Feb 2026 16:07:48 +0530 Subject: [PATCH 4/6] Update auto-release.yml --- .github/workflows/auto-release.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 82181a7..f1bb154 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -52,24 +52,23 @@ jobs: # Read version from repo (SOURCE OF TRUTH) # Adjust this if you store version elsewhere # -------------------------------------------- - - name: Read version from assets + - name: Read version from bower.json run: | - # Example: extract version from any JS/CSS reference - VERSION=$(grep -RhoE '[0-9]+\.[0-9]+\.[0-9]+' public | head -n1) - - if [ -z "$VERSION" ]; then - echo "Failed to determine version from repository" + VERSION=$(jq -r '.version' bower.json) + + if [ -z "$VERSION" ] || [ "$VERSION" = "null" ]; then + echo "Failed to determine version from bower.json" exit 1 fi - + if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then echo "Invalid version format: $VERSION" exit 1 fi - + echo "VERSION=$VERSION" >> $GITHUB_ENV echo "Releasing version $VERSION" - + # -------------------------------------------- # Prepare clean release notes from PR body # -------------------------------------------- From 5b52dc32f353cc0abb8ea606e174fa5357ee64f8 Mon Sep 17 00:00:00 2001 From: froala-travis-bot Date: Wed, 18 Feb 2026 13:02:04 +0000 Subject: [PATCH 5/6] chore: release Python SDK v3.0.7 --- bower.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 919d99a..d9fee1c 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "froala-editor-python-sdk", - "version": "3.0.6", + "version": "3.0.7", "author": "Florin Marius Popescu (https://www.froala.com/)", "description": "Node.js SDK for Froala Editor", "keywords": [ @@ -16,6 +16,6 @@ "bower_components" ], "dependencies": { - "froala-wysiwyg-editor": "^3.0.6" + "froala-wysiwyg-editor": "^3.0.7" } } From c41c71dc08c3717774adcb0509e9fda811d08dd5 Mon Sep 17 00:00:00 2001 From: alpha2026a Date: Fri, 20 Feb 2026 09:47:10 +0530 Subject: [PATCH 6/6] Update auto-release.yml --- .github/workflows/auto-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index f1bb154..462f12e 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -14,6 +14,7 @@ jobs: # Run only when PR is merged if: github.event.pull_request.merged == true runs-on: ubuntu-latest + steps: # --------------------------------------------