From 93fa31111808038184c73cf616d1759b9fe834ab Mon Sep 17 00:00:00 2001 From: alpha2026a Date: Fri, 6 Mar 2026 19:30:46 +0530 Subject: [PATCH 1/7] Create sync-version.yml --- .github/workflows/sync-version.yml | 103 +++++++++++++++++++++++++++++ 1 file changed, 103 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..efa940f --- /dev/null +++ b/.github/workflows/sync-version.yml @@ -0,0 +1,103 @@ +name: Release + +on: + repository_dispatch: + types: [version_update] + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.PAT }} + + - name: Load version + run: | + VERSION="${{ github.event.client_payload.version }}" + + if [ -z "$VERSION" ]; then + echo "Version is missing" + exit 1 + fi + + if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Invalid version format: $VERSION" + exit 1 + fi + + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "Using version $VERSION" + + - name: Compare current version + run: | + CURRENT_VERSION=$(jq -r '.version' ./Examples/bower.json) + + if [ -z "$CURRENT_VERSION" ] || [ "$CURRENT_VERSION" = "null" ]; then + echo "Could not read the current version from bower.json" + exit 1 + fi + + echo "Current version: $CURRENT_VERSION" + echo "Incoming version: $VERSION" + + if [ "$CURRENT_VERSION" = "$VERSION" ]; then + echo "The version is already up to date. No changes needed." + exit 0 + fi + + echo "New version detected. Continuing with release process." + + - 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 + + - name: Update ./Examples/bower.json + run: | + jq --arg VERSION "$VERSION" '.version = $VERSION' ./Examples/bower.json > tmp.json + mv tmp.json ./Examples/bower.json + + - name: Commit changes + run: | + git config user.name "froala-travis-bot" + git config user.email "froala_git_travis_bot@idera.com" + git add ./Examples/bower.json + git commit -m "chore: update Examples/bower.json to v${VERSION}" || echo "Nothing to commit" + git push origin "$BRANCH" + + - 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 7843d0d7bef679183d7ea17ebaff6bc33937d43e Mon Sep 17 00:00:00 2001 From: alpha2026a Date: Fri, 6 Mar 2026 19:32:33 +0530 Subject: [PATCH 2/7] Create auto-release.yml --- .github/workflows/auto-release.yml | 85 ++++++++++++++++++++++++++++++ 1 file changed, 85 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..cbdc436 --- /dev/null +++ b/.github/workflows/auto-release.yml @@ -0,0 +1,85 @@ +name: Auto Release – node + +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: + - 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 + + + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.PAT }} + fetch-depth: 0 + + + - name: Read version from bower.json + run: | + VERSION=$(jq -r '.version' ./Examples/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" + + + - 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 + + + - name: Create GitHub Release + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + run: | + gh release create "v${VERSION}" \ + --title "Release ${VERSION}" \ + --notes "$RELEASE_NOTES" \ + --latest From f10de8e72c6aa7c876e9e3fc5ea9781919853e6f Mon Sep 17 00:00:00 2001 From: alpha2026a Date: Fri, 6 Mar 2026 19:33:29 +0530 Subject: [PATCH 3/7] Update sync-version.yml --- .github/workflows/sync-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-version.yml b/.github/workflows/sync-version.yml index efa940f..64c007b 100644 --- a/.github/workflows/sync-version.yml +++ b/.github/workflows/sync-version.yml @@ -1,4 +1,4 @@ -name: Release +name: Sync Version – Java SDK on: repository_dispatch: From c35b36a1d3d423bf46257637450305a13b53baee Mon Sep 17 00:00:00 2001 From: alpha2026a Date: Fri, 6 Mar 2026 19:37:35 +0530 Subject: [PATCH 4/7] Update sync-version.yml --- .github/workflows/sync-version.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync-version.yml b/.github/workflows/sync-version.yml index 64c007b..96b398c 100644 --- a/.github/workflows/sync-version.yml +++ b/.github/workflows/sync-version.yml @@ -12,7 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 with: token: ${{ secrets.PAT }} From 05da94f53afa5465cc7019ac0ae04837d7e7f949 Mon Sep 17 00:00:00 2001 From: alpha2026a Date: Fri, 6 Mar 2026 21:41:15 +0530 Subject: [PATCH 5/7] Update sync-version.yml --- .github/workflows/sync-version.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sync-version.yml b/.github/workflows/sync-version.yml index 96b398c..5ed0409 100644 --- a/.github/workflows/sync-version.yml +++ b/.github/workflows/sync-version.yml @@ -5,13 +5,13 @@ on: types: [version_update] permissions: - contents: write + contents: write jobs: - release: - runs-on: ubuntu-latest + release: + runs-on: ubuntu-latest - steps: + steps: - name: Checkout repository uses: actions/checkout@v4 with: @@ -80,11 +80,11 @@ jobs: git commit -m "chore: update Examples/bower.json to v${VERSION}" || echo "Nothing to commit" git push origin "$BRANCH" - - name: Create Pull Request - env: + - name: Create Pull Request + env: GH_TOKEN: ${{ secrets.PAT }} RELEASE_NOTES: ${{ github.event.client_payload.release_notes }} - run: | + run: | git fetch origin master if git diff --quiet origin/master..."$BRANCH"; then From e67e4b8f531e201979afa1b5d3bbafaead9755a8 Mon Sep 17 00:00:00 2001 From: froala-travis-bot Date: Fri, 6 Mar 2026 16:11:57 +0000 Subject: [PATCH 6/7] chore: update Examples/bower.json to v3.0.15 --- Examples/bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/bower.json b/Examples/bower.json index 3c353c4..42ba4e8 100644 --- a/Examples/bower.json +++ b/Examples/bower.json @@ -1,6 +1,6 @@ { "name": "froala-editor-java-sdk", - "version": "5.0.1", + "version": "3.0.15", "author": "Florin Marius Popescu (https://www.froala.com/)", "description": "Java SDK for Froala Editor", "keywords": [ From 6468502199498d7493542f4bea5edebd2cb4d7c4 Mon Sep 17 00:00:00 2001 From: alpha2026a Date: Fri, 6 Mar 2026 21:50:48 +0530 Subject: [PATCH 7/7] Update bower.json --- Examples/bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/bower.json b/Examples/bower.json index 42ba4e8..3c353c4 100644 --- a/Examples/bower.json +++ b/Examples/bower.json @@ -1,6 +1,6 @@ { "name": "froala-editor-java-sdk", - "version": "3.0.15", + "version": "5.0.1", "author": "Florin Marius Popescu (https://www.froala.com/)", "description": "Java SDK for Froala Editor", "keywords": [