From 14476a908f2c10d907417187c41ce255ac2ea6a6 Mon Sep 17 00:00:00 2001 From: kschrief Date: Mon, 8 Apr 2024 11:20:33 -0400 Subject: [PATCH 1/2] feat: CI/CD Merging from next (#183) * Push new workflows --- .github/workflows/merge-to-main.yml | 43 ++++++++++++++ .github/workflows/merge-to-next-major.yml | 72 +++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 .github/workflows/merge-to-main.yml create mode 100644 .github/workflows/merge-to-next-major.yml diff --git a/.github/workflows/merge-to-main.yml b/.github/workflows/merge-to-main.yml new file mode 100644 index 00000000..2c4c8f1d --- /dev/null +++ b/.github/workflows/merge-to-main.yml @@ -0,0 +1,43 @@ +name: Attempt to merge next to main +on: + workflow_dispatch: + +jobs: + # Check if next can merge into main + perform_merge: + name: Perform merge if "next" can merge into "main" + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + repo-token: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} + persist-credentials: true + + # Set user identity + - name: Set-Identity + run: | + git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}" + git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}" + + # Checkout "main" + - name: Checkout main + run: git checkout "main" + + - name: Perform the merge from next to main + run: | + git merge next + git push origin "main" + echo "Push to main succeeded" + + # If the merge cannot be performed, let stakeholders know + message_on_failure: + name: Merge failure + needs: perform_merge + runs-on: ubuntu-latest + if: ${{ failure() }} + + steps: + - name: Post error message (To-Do) + run: echo "Next cannot be merged into main cleanly" diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml new file mode 100644 index 00000000..c2af8335 --- /dev/null +++ b/.github/workflows/merge-to-next-major.yml @@ -0,0 +1,72 @@ +name: Attempt to merge next to next-major +on: + workflow_dispatch: + push: + branches: + - "next" + +jobs: + # Check if next can merge into next-major + perform_merge: + name: Perform merge if "next" can merge into "next-major" + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + repo-token: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} + persist-credentials: true + + # Set user identity + - name: Set-Identity + run: | + git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}" + git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}" + + # Checkout "next-major" + - name: Checkout next-major + run: git checkout "next-major" + + # Get the "next-major" version number + - name: Extract next-major version + id: extract_version + run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')" + + # Checkout "next" + - name: Checkout next + run: git checkout "next" + + # Update "next" version to match "next-major" + - name: Update "next" version to match "next-major" + run: | + jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json + + if diff -q "package.json" "temp.json" >/dev/null; then + echo "Versions are identical. No change required." + rm temp.json + else + mv temp.json package.json + git add package.json && git commit -m "Sync version to ${{ steps.extract_version.outputs.version }}" + fi + + # Checkout "next-major" + - name: Checkout next-major + run: git checkout "next-major" + + - name: Perform the merge from next to next-major + run: | + git merge next + git push origin "next-major" + echo "Push to next-major succeeded" + + # If the merge cannot be performed, let stakeholders know + message_on_failure: + name: Merge failure + needs: perform_merge + runs-on: ubuntu-latest + if: ${{ failure() }} + + steps: + - name: Post error message (To-Do) + run: echo "Next cannot be merged into next-major cleanly" From 97fc800dbe54bdae01a405e66d51bc146d584e71 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 8 Apr 2024 15:21:28 +0000 Subject: [PATCH 2/2] chore(release): 3.0.0-next.2 [skip ci] # [3.0.0-next.2](https://github.com/rdkcentral/firebolt-openrpc/compare/v3.0.0-next.1...v3.0.0-next.2) (2024-04-08) ### Features * CI/CD Merging from next ([#183](https://github.com/rdkcentral/firebolt-openrpc/issues/183)) ([14476a9](https://github.com/rdkcentral/firebolt-openrpc/commit/14476a908f2c10d907417187c41ce255ac2ea6a6)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c84e0953..ccfeb8f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [3.0.0-next.2](https://github.com/rdkcentral/firebolt-openrpc/compare/v3.0.0-next.1...v3.0.0-next.2) (2024-04-08) + + +### Features + +* CI/CD Merging from next ([#183](https://github.com/rdkcentral/firebolt-openrpc/issues/183)) ([14476a9](https://github.com/rdkcentral/firebolt-openrpc/commit/14476a908f2c10d907417187c41ce255ac2ea6a6)) + # [3.0.0-next.1](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.3.0-next.1...v3.0.0-next.1) (2024-03-26) diff --git a/package-lock.json b/package-lock.json index 42e411f8..fdc9f7b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@firebolt-js/openrpc", - "version": "3.0.0-next.1", + "version": "3.0.0-next.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@firebolt-js/openrpc", - "version": "3.0.0-next.1", + "version": "3.0.0-next.2", "license": "Apache-2.0", "dependencies": { "ajv": "^8.3.0", diff --git a/package.json b/package.json index 2b70991f..99fa850e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@firebolt-js/openrpc", - "version": "3.0.0-next.1", + "version": "3.0.0-next.2", "description": "The Firebolt SDK Code & Doc Generator", "main": "languages/javascript/src/sdk.mjs", "type": "module",