From c9896f7ea16119a6c9cd12a7196f4d34716021d7 Mon Sep 17 00:00:00 2001 From: kschrief Date: Fri, 23 Feb 2024 10:48:41 -0500 Subject: [PATCH 01/34] Push new workflow --- .github/workflows/merge-to-next-major.yml | 88 +++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 .github/workflows/merge-to-next-major.yml diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml new file mode 100644 index 00000000..fd1d16fc --- /dev/null +++ b/.github/workflows/merge-to-next-major.yml @@ -0,0 +1,88 @@ +name: Attempt to merge next to next-major +on: + workflow_dispatch: + push: + branches: + - "next" + +jobs: + # Always run. Check to see if we can merge "next" into "next-major" + check_merge: + name: check-merge + 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 + + # Attempt a dry-run merge + - name: Attempt merge + run: | + git checkout "next-major" + git merge --no-commit --no-ff origin/${{github.ref_name}} + + # Check the status and pass it off to process_merge_status + - name: Check merge status + run: | + if [ $? -eq 0 ]; then + echo "Able to successfully merge next into next-major" + exit 0 + else + echo "Not able to merge next into next-major" + exit 1 + fi + + # Run if we are able to perform a merge from next to next-major + process_merge_on_success: + name: process_merge_on_success + needs: check_merge + runs-on: ubuntu-latest + if: ${{ success() }} + + steps: + - name: Perform Merge + run: | + git checkout "next-major" + checkout_status=$? + + git merge origin/next + merge_status=$? + + git push origin "next-major" + push_status=$? + + if [ "$checkout_status" -eq 0 ] && [ "$merge_status" -eq 0 ] && [ "$push_status" -eq 0 ]; then + echo "Push to next-major succeeded" + else + exit 1 + fi + + # Run if we detected we could not perform a merge due to a conflict + process_merge_on_failure: + name: process_merge_on_failure + needs: check_merge + runs-on: ubuntu-latest + if: ${{ failure() }} + + steps: + - name: Post error message + run: + echo "I'm gonna say I couldn't merge to next-major due to a conflict" + #curl -X POST -H 'Content-type: application/json' --data '{"text":"Merge from next to next-major contains conflicts!"}' | + #${{ secrets.SLACK_WEBHOOK_URL_NEXT_MAJOR_MERGE }} + + # Run if we attempted to merge/push to next-main but were unable to do so + process_push_failure: + needs: process_merge_on_success + runs-on: ubuntu-latest + if: ${{ failure() }} + + steps: + - name: Post push error message + run: + echo "I'm gonna say I tried and failed to merge next to next-major" + #curl -X POST -H 'Content-type: application/json' --data '{"text":"Push to next-major was unsuccessful!"}' | + #${{ secrets.SLACK_WEBHOOK_URL_NEXT_MAJOR_MERGE }} From 0372e6e4b3360af0cfbb34010064dac4dda72e39 Mon Sep 17 00:00:00 2001 From: kschrief Date: Fri, 23 Feb 2024 10:50:45 -0500 Subject: [PATCH 02/34] Remove scary github actions --- .github/workflows/release.yml | 38 ----------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 1e13808a..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Release to GitHub and NPM -on: - workflow_dispatch: - push: - branches: - - 'main' - - 'next' -env: - HUSKY: 0 -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repo-token: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} - persist-credentials: false - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 'lts/*' - - name: Set explicit npm dist-tag default - if: github.ref_name == 'main' - run: echo "NPM_DIST_TAG=latest" >> $GITHUB_ENV - - name: Override npm dist-tag for non-main releases - if: github.ref_name != 'main' - run: echo "NPM_DIST_TAG=${{ github.ref_name }}" >> $GITHUB_ENV - - name: Install dependencies - run: npm ci - - name: Release to GitHub and NPM - env: - GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} # <-- Allows semantic-release-bot to push changes to protected branches - NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }} # <-- Allows semantic-release to publish to npm without 2 factor auth. - npm_config_tag: ${{ env.NPM_DIST_TAG }} # <-- For main, this is `latest.` Otherwise, `next`, `next-major`, etc. See ./.releaserc for release branch config. - run: npx semantic-release From 82f409ffe29367504d9c5747a38971efeb1bedaa Mon Sep 17 00:00:00 2001 From: kschrief Date: Fri, 23 Feb 2024 10:52:15 -0500 Subject: [PATCH 03/34] Update --- .github/workflows/merge-to-next-major.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index fd1d16fc..c7f920f5 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -21,6 +21,8 @@ jobs: # Attempt a dry-run merge - name: Attempt merge run: | + ls -l + git branch git checkout "next-major" git merge --no-commit --no-ff origin/${{github.ref_name}} From fa379941f074cb07dcddbafca9b8bd2838dab9c2 Mon Sep 17 00:00:00 2001 From: kschrief Date: Fri, 23 Feb 2024 10:57:20 -0500 Subject: [PATCH 04/34] Trigger --- .github/workflows/merge-to-next-major.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index c7f920f5..361d5b86 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -6,7 +6,7 @@ on: - "next" jobs: - # Always run. Check to see if we can merge "next" into "next-major" + # Always run. Check to see if we can merge "next" into "next-major " check_merge: name: check-merge runs-on: ubuntu-latest From b1fe3bd14cc009a2276cddfec1e014c67c0d2f56 Mon Sep 17 00:00:00 2001 From: kschrief Date: Fri, 23 Feb 2024 10:59:22 -0500 Subject: [PATCH 05/34] Trigger --- .github/workflows/merge-to-next-major.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 361d5b86..db9552d3 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -18,6 +18,12 @@ jobs: repo-token: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} persist-credentials: true + # Set user identity + - name: Set-Identity + run: | + git config --global user.email "kschriefer91@gmail.com" + git config --global user.name "kschrief" + # Attempt a dry-run merge - name: Attempt merge run: | From f5ac990601a12e6722216677013c3dd414745297 Mon Sep 17 00:00:00 2001 From: kschrief Date: Fri, 23 Feb 2024 11:02:30 -0500 Subject: [PATCH 06/34] Trigger --- .github/workflows/merge-to-next-major.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index db9552d3..4818c549 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -51,6 +51,19 @@ jobs: if: ${{ success() }} 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 "kschriefer91@gmail.com" + git config --global user.name "kschrief" + - name: Perform Merge run: | git checkout "next-major" From 806e737993d7bfb8504c4cacb5a63a2582d3f464 Mon Sep 17 00:00:00 2001 From: kschrief Date: Fri, 23 Feb 2024 11:04:14 -0500 Subject: [PATCH 07/34] Introduce conflict --- .github/workflows/merge-to-next-major.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 4818c549..5f01860b 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -6,7 +6,7 @@ on: - "next" jobs: - # Always run. Check to see if we can merge "next" into "next-major " + # I too am a conflict check_merge: name: check-merge runs-on: ubuntu-latest From b423f5c17da5a86426f35c9c6bf20324b7d84e6e Mon Sep 17 00:00:00 2001 From: kschrief Date: Fri, 23 Feb 2024 11:07:23 -0500 Subject: [PATCH 08/34] Yes. Good. --- .github/workflows/merge-to-next-major.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 5f01860b..76bae868 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -99,7 +99,7 @@ jobs: process_push_failure: needs: process_merge_on_success runs-on: ubuntu-latest - if: ${{ failure() }} + if: ${{ failure() && needs.process_merge_on_success.result != 'skipped' }} steps: - name: Post push error message From 2aa497c6074d39331501cc37c1bb856515a366bd Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 11:43:42 -0500 Subject: [PATCH 09/34] Get version number --- .github/workflows/merge-to-next-major.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 76bae868..c7e7bb65 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -24,6 +24,14 @@ jobs: git config --global user.email "kschriefer91@gmail.com" git config --global user.name "kschrief" + # Get the "next" version number + - name: Extract next version + id: extract_version + run: echo "::set-output name=version::$(node -e 'console.log(require(./package.json).version)')" + + - name: Display version number + run: echo "Version is ${{ steps.extract_version.outputs.version }}" + # Attempt a dry-run merge - name: Attempt merge run: | From 337d36ef2e4d6ed560d1f2b3c6294501cc9615e1 Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 11:44:50 -0500 Subject: [PATCH 10/34] Get version number --- .github/workflows/merge-to-next-major.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index c7e7bb65..1aa5c357 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -27,7 +27,7 @@ jobs: # Get the "next" version number - name: Extract next version id: extract_version - run: echo "::set-output name=version::$(node -e 'console.log(require(./package.json).version)')" + run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')" - name: Display version number run: echo "Version is ${{ steps.extract_version.outputs.version }}" From 90895c6d3449428f5709342900db2b37868be99c Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 11:52:21 -0500 Subject: [PATCH 11/34] Get version number --- .github/workflows/merge-to-next-major.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 1aa5c357..5bea0272 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -29,15 +29,23 @@ jobs: id: extract_version run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')" - - name: Display version number - run: echo "Version is ${{ steps.extract_version.outputs.version }}" + # Checkout "next-major" + - name: Checkout next-major + run: git checkout "next-major" + + # Update package.json version + - name: Update next-major package.json + run: | + jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json + mv temp.json package.json + + # Temp - Print package.json + - name: Temp - Print package.json + run: cat package.json # Attempt a dry-run merge - name: Attempt merge run: | - ls -l - git branch - git checkout "next-major" git merge --no-commit --no-ff origin/${{github.ref_name}} # Check the status and pass it off to process_merge_status From d829527329c2b7435dd427ab4ff28dbaa1ff298b Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 12:01:33 -0500 Subject: [PATCH 12/34] Commit version change --- .github/workflows/merge-to-next-major.yml | 24 +++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 5bea0272..0e5809f8 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -39,10 +39,6 @@ jobs: jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json mv temp.json package.json - # Temp - Print package.json - - name: Temp - Print package.json - run: cat package.json - # Attempt a dry-run merge - name: Attempt merge run: | @@ -80,18 +76,30 @@ jobs: git config --global user.email "kschriefer91@gmail.com" git config --global user.name "kschrief" - - name: Perform Merge + # Get the "next" version number + - name: Extract next version + id: extract_version + run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')" + + - name: Checkout next-major + run: git checkout "next-major" + + # Update package.json version + - name: Update next-major package.json run: | - git checkout "next-major" - checkout_status=$? + jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json + mv temp.json package.json + git commit -m "Sync next->next-major package.json" + - name: Perform Merge + run: | git merge origin/next merge_status=$? git push origin "next-major" push_status=$? - if [ "$checkout_status" -eq 0 ] && [ "$merge_status" -eq 0 ] && [ "$push_status" -eq 0 ]; then + if [ "$merge_status" -eq 0 ] && [ "$push_status" -eq 0 ]; then echo "Push to next-major succeeded" else exit 1 From 3cdbd3c407d567c283f11d05490a7bb24b438fce Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 12:02:38 -0500 Subject: [PATCH 13/34] Commit version change --- .github/workflows/merge-to-next-major.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 0e5809f8..7e002663 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -34,10 +34,10 @@ jobs: run: git checkout "next-major" # Update package.json version - - name: Update next-major package.json - run: | - jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json - mv temp.json package.json + #- name: Update next-major package.json + # run: | + # jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json + # mv temp.json package.json # Attempt a dry-run merge - name: Attempt merge From 814e1b58a494d6c8d5ad02e6a4d9146c5bceae99 Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 12:04:17 -0500 Subject: [PATCH 14/34] Commit version change --- .github/workflows/merge-to-next-major.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 7e002663..c9fed7f3 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -34,10 +34,10 @@ jobs: run: git checkout "next-major" # Update package.json version - #- name: Update next-major package.json - # run: | - # jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json - # mv temp.json package.json + - name: Update next-major package.json + run: | + jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json + mv temp.json package.json # Attempt a dry-run merge - name: Attempt merge @@ -89,6 +89,7 @@ jobs: run: | jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json mv temp.json package.json + git add package.json git commit -m "Sync next->next-major package.json" - name: Perform Merge From 37a11a0465236bdef530bf531490d056c855eea3 Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 12:06:15 -0500 Subject: [PATCH 15/34] Exit 0 --- .github/workflows/merge-to-next-major.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index c9fed7f3..96b7e579 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -102,6 +102,7 @@ jobs: if [ "$merge_status" -eq 0 ] && [ "$push_status" -eq 0 ]; then echo "Push to next-major succeeded" + exit 0 else exit 1 fi From a6bd102cc50cb2e8a7675dd604d557586229cbee Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 13:15:14 -0500 Subject: [PATCH 16/34] Versions --- .github/workflows/merge-to-next-major.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 96b7e579..07dbc9a2 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -88,9 +88,16 @@ jobs: - name: Update next-major package.json run: | jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json - mv temp.json package.json - git add package.json - git commit -m "Sync next->next-major package.json" + + #Commit if there was a difference + if diff -q "package.json" "temp.json" > /dev/null; then + mv temp.json package.json + git add package.json + git commit -m "Sync next->next-major package.json" + else + echo "Versions are identical. No update required." + rm temp.json + fi - name: Perform Merge run: | From 70025d4be65a45be30333b2d2a0429e198bffa93 Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 13:17:07 -0500 Subject: [PATCH 17/34] Versions --- .github/workflows/merge-to-next-major.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 07dbc9a2..e502f506 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -89,15 +89,8 @@ jobs: run: | jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json - #Commit if there was a difference - if diff -q "package.json" "temp.json" > /dev/null; then - mv temp.json package.json - git add package.json - git commit -m "Sync next->next-major package.json" - else - echo "Versions are identical. No update required." - rm temp.json - fi + mv temp.json package.json + git add package.json && git commit -m "Sync next->next-major package.json" - name: Perform Merge run: | From 39fe788ccb0ee79f17a8afa9d80db3c88a26d7c9 Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 13:20:18 -0500 Subject: [PATCH 18/34] Versions --- .github/workflows/merge-to-next-major.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index e502f506..20a15d19 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -89,8 +89,14 @@ jobs: run: | jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json - mv temp.json package.json - git add package.json && git commit -m "Sync next->next-major package.json" + diff -q "package.json" "temp.json" + + if [ "$?" -eq 0 ]; then + mv temp.json package.json + git add package.json && git commit -m "Sync next->next-major package.json" + else + echo "Versions are identical. No change required." + fi - name: Perform Merge run: | From 9849b7cf6157487d621af1d8b2ed2567a2d7db4a Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 13:21:09 -0500 Subject: [PATCH 19/34] Versions --- .github/workflows/merge-to-next-major.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 20a15d19..df8cc5de 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -91,7 +91,7 @@ jobs: diff -q "package.json" "temp.json" - if [ "$?" -eq 0 ]; then + if [ "$?" -ne 0 ]; then mv temp.json package.json git add package.json && git commit -m "Sync next->next-major package.json" else From 63c4013de2b7cb5b1c111d2a0904d62922dc557c Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 13:22:38 -0500 Subject: [PATCH 20/34] Conflict --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cafd1855..b7c557ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@firebolt-js/openrpc", - "version": "2.3.0-next.1", + "version": "2.3.0-next.2", "description": "The Firebolt SDK Code & Doc Generator", "main": "languages/javascript/src/sdk.mjs", "type": "module", From cf09ec1304dae3d270726b5296b4b7dbce91523d Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 13:24:31 -0500 Subject: [PATCH 21/34] Conflict --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b7c557ae..87facaa5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@firebolt-js/openrpc", - "version": "2.3.0-next.2", + "version": "2.3.0-next.3", "description": "The Firebolt SDK Code & Doc Generator", "main": "languages/javascript/src/sdk.mjs", "type": "module", From dddf189f5a3039bbc20a0d288fac54bf6a2d74ae Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 13:25:44 -0500 Subject: [PATCH 22/34] Conflict --- .github/workflows/merge-to-next-major.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index df8cc5de..572ca68f 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -37,7 +37,16 @@ jobs: - name: Update next-major package.json run: | jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json - mv temp.json package.json + + diff -q "package.json" "temp.json" + + if [ "$?" -ne 0 ]; then + mv temp.json package.json + git add package.json && git commit -m "Sync next->next-major package.json" + else + echo "Versions are identical. No change required." + rm temp.json + fi # Attempt a dry-run merge - name: Attempt merge @@ -96,6 +105,7 @@ jobs: git add package.json && git commit -m "Sync next->next-major package.json" else echo "Versions are identical. No change required." + rm temp.json fi - name: Perform Merge From 0848c869ac40ffdefab34c4563c627d1b38993a8 Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 13:28:03 -0500 Subject: [PATCH 23/34] Conflict --- .github/workflows/merge-to-next-major.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 572ca68f..2b401e9a 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -38,14 +38,12 @@ jobs: run: | jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json - diff -q "package.json" "temp.json" - - if [ "$?" -ne 0 ]; then - mv temp.json package.json - git add package.json && git commit -m "Sync next->next-major package.json" - else + 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 next->next-major package.json" fi # Attempt a dry-run merge From e6171a99a7beda4f8964de91f3e359d6b5a63f83 Mon Sep 17 00:00:00 2001 From: kschrief Date: Tue, 27 Feb 2024 13:28:54 -0500 Subject: [PATCH 24/34] Conflict --- .github/workflows/merge-to-next-major.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 2b401e9a..52c61f94 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -96,14 +96,12 @@ jobs: run: | jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json - diff -q "package.json" "temp.json" - - if [ "$?" -ne 0 ]; then - mv temp.json package.json - git add package.json && git commit -m "Sync next->next-major package.json" - else + 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 next->next-major package.json" fi - name: Perform Merge From fa25feb0a58b9aceed71664f60eda86c5865a8d9 Mon Sep 17 00:00:00 2001 From: kschrief Date: Wed, 28 Feb 2024 10:38:34 -0500 Subject: [PATCH 25/34] Finishing touches --- .github/workflows/merge-to-next-major.yml | 62 +++++++++-------------- 1 file changed, 24 insertions(+), 38 deletions(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 52c61f94..141b3b2e 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -6,7 +6,7 @@ on: - "next" jobs: - # I too am a conflict + # Check if next can merge into next-major check_merge: name: check-merge runs-on: ubuntu-latest @@ -21,8 +21,8 @@ jobs: # Set user identity - name: Set-Identity run: | - git config --global user.email "kschriefer91@gmail.com" - git config --global user.name "kschrief" + git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}" + git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}" # Get the "next" version number - name: Extract next version @@ -33,8 +33,8 @@ jobs: - name: Checkout next-major run: git checkout "next-major" - # Update package.json version - - name: Update next-major package.json + # Update "next-major" package.json to match "next" + - name: Update "next-major" package.json to match "next" run: | jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json @@ -43,28 +43,18 @@ jobs: rm temp.json else mv temp.json package.json - git add package.json && git commit -m "Sync next->next-major package.json" + git add package.json && git commit -m "Sync version to ${{ steps.extract_version.outputs.version }}" fi # Attempt a dry-run merge - - name: Attempt merge + - name: Attempt a dry-run merge run: | git merge --no-commit --no-ff origin/${{github.ref_name}} + exit $? - # Check the status and pass it off to process_merge_status - - name: Check merge status - run: | - if [ $? -eq 0 ]; then - echo "Able to successfully merge next into next-major" - exit 0 - else - echo "Not able to merge next into next-major" - exit 1 - fi - - # Run if we are able to perform a merge from next to next-major + # Attempt to merge to next-major if our dry-run succeeded process_merge_on_success: - name: process_merge_on_success + name: Perform merge from "next" to "next-major" needs: check_merge runs-on: ubuntu-latest if: ${{ success() }} @@ -80,19 +70,20 @@ jobs: # Set user identity - name: Set-Identity run: | - git config --global user.email "kschriefer91@gmail.com" - git config --global user.name "kschrief" + git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}" + git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}" # Get the "next" version number - name: Extract next version id: extract_version run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')" + # Checkout "next-major" - name: Checkout next-major run: git checkout "next-major" - # Update package.json version - - name: Update next-major package.json + # Update "next-major" package.json to match "next" + - name: Update "next-major" package.json to match "next" run: | jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json @@ -104,7 +95,7 @@ jobs: git add package.json && git commit -m "Sync next->next-major package.json" fi - - name: Perform Merge + - name: Perform the merge from next to next-major run: | git merge origin/next merge_status=$? @@ -119,29 +110,24 @@ jobs: exit 1 fi - # Run if we detected we could not perform a merge due to a conflict + # If the merge cannot be performed, let stakeholders know process_merge_on_failure: - name: process_merge_on_failure + name: Merge dry-run failure needs: check_merge runs-on: ubuntu-latest if: ${{ failure() }} steps: - - name: Post error message - run: - echo "I'm gonna say I couldn't merge to next-major due to a conflict" - #curl -X POST -H 'Content-type: application/json' --data '{"text":"Merge from next to next-major contains conflicts!"}' | - #${{ secrets.SLACK_WEBHOOK_URL_NEXT_MAJOR_MERGE }} + - name: Post error message (To-Do) + run: echo "Next cannot be merged into next-major cleanly" - # Run if we attempted to merge/push to next-main but were unable to do so + # If we attempted to merge/push to next-main but there was a failure process_push_failure: + name: Merge failure needs: process_merge_on_success runs-on: ubuntu-latest if: ${{ failure() && needs.process_merge_on_success.result != 'skipped' }} steps: - - name: Post push error message - run: - echo "I'm gonna say I tried and failed to merge next to next-major" - #curl -X POST -H 'Content-type: application/json' --data '{"text":"Push to next-major was unsuccessful!"}' | - #${{ secrets.SLACK_WEBHOOK_URL_NEXT_MAJOR_MERGE }} + - name: Post error message (To-Do) + run: echo "There was a failure when merging next into next-major" From b2a5c5f7061621b5f6fb5e089fc697704c1aa7da Mon Sep 17 00:00:00 2001 From: kschrief Date: Wed, 28 Feb 2024 10:39:19 -0500 Subject: [PATCH 26/34] Finishing touches --- .github/workflows/merge-to-next-major.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 141b3b2e..d5cb205e 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -8,7 +8,7 @@ on: jobs: # Check if next can merge into next-major check_merge: - name: check-merge + name: Check if "next" can merge into "next-major" runs-on: ubuntu-latest steps: - name: Checkout From d4690bad2f49dbc21aeca62e0814aeeba3379125 Mon Sep 17 00:00:00 2001 From: kschrief Date: Wed, 28 Feb 2024 10:44:26 -0500 Subject: [PATCH 27/34] Merge to main --- .github/workflows/merge-to-main.yml | 94 +++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 .github/workflows/merge-to-main.yml diff --git a/.github/workflows/merge-to-main.yml b/.github/workflows/merge-to-main.yml new file mode 100644 index 00000000..edbc5ea1 --- /dev/null +++ b/.github/workflows/merge-to-main.yml @@ -0,0 +1,94 @@ +name: Attempt to merge next to main +on: + workflow_dispatch: + +jobs: + # Check if next can merge into main + check_merge: + name: Check 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" + + # Attempt a dry-run merge + - name: Attempt a dry-run merge + run: | + git merge --no-commit --no-ff origin/${{github.ref_name}} + exit $? + + # Attempt to merge to main if our dry-run succeeded + process_merge_on_success: + name: Perform merge from "next" to "main" + needs: check_merge + runs-on: ubuntu-latest + if: ${{ success() }} + + 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 origin/next + merge_status=$? + + git push origin "main" + push_status=$? + + if [ "$merge_status" -eq 0 ] && [ "$push_status" -eq 0 ]; then + echo "Push to main succeeded" + exit 0 + else + exit 1 + fi + + # If the merge cannot be performed, let stakeholders know + process_merge_on_failure: + name: Merge dry-run failure + needs: check_merge + runs-on: ubuntu-latest + if: ${{ failure() }} + + steps: + - name: Post error message (To-Do) + run: echo "Next cannot be merged into main cleanly" + + # If we attempted to merge/push to next-main but there was a failure + process_push_failure: + name: Merge failure + needs: process_merge_on_success + runs-on: ubuntu-latest + if: ${{ failure() && needs.process_merge_on_success.result != 'skipped' }} + + steps: + - name: Post error message (To-Do) + run: echo "There was a failure when merging next into main" From e67ba1fe879675c1191c8cd16e1565826dd58341 Mon Sep 17 00:00:00 2001 From: kschrief Date: Wed, 28 Feb 2024 11:43:55 -0500 Subject: [PATCH 28/34] Change next->main script --- .github/workflows/merge-to-main.yml | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/merge-to-main.yml b/.github/workflows/merge-to-main.yml index edbc5ea1..14b46fe2 100644 --- a/.github/workflows/merge-to-main.yml +++ b/.github/workflows/merge-to-main.yml @@ -21,10 +21,28 @@ jobs: git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}" git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}" + # Get the "next" version number + - name: Extract next version + id: extract_version + run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')" + # Checkout "main" - name: Checkout main run: git checkout "main" + # Update "main" package.json to match "next" + - name: Update "main" package.json to match "next" + 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 + # Attempt a dry-run merge - name: Attempt a dry-run merge run: | @@ -52,10 +70,28 @@ jobs: git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}" git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}" + # Get the "next" version number + - name: Extract next version + id: extract_version + run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')" + # Checkout "main" - name: Checkout main run: git checkout "main" + # Update "main" package.json to match "next" + - name: Update "main" package.json to match "next" + 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 next->main package.json" + fi + - name: Perform the merge from next to main run: | git merge origin/next From 682a75065a75d87158bd8e1194a508987d2eddcd Mon Sep 17 00:00:00 2001 From: kschrief Date: Wed, 28 Feb 2024 11:47:45 -0500 Subject: [PATCH 29/34] Better commit message --- .github/workflows/merge-to-main.yml | 13 ++++++++----- .github/workflows/merge-to-next-major.yml | 10 +++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/merge-to-main.yml b/.github/workflows/merge-to-main.yml index 14b46fe2..aaee22f0 100644 --- a/.github/workflows/merge-to-main.yml +++ b/.github/workflows/merge-to-main.yml @@ -1,6 +1,9 @@ name: Attempt to merge next to main on: workflow_dispatch: + push: + branches: + - "next" jobs: # Check if next can merge into main @@ -30,8 +33,8 @@ jobs: - name: Checkout main run: git checkout "main" - # Update "main" package.json to match "next" - - name: Update "main" package.json to match "next" + # Update "main" version to match "next" + - name: Update "main" version to match "next" run: | jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json @@ -79,8 +82,8 @@ jobs: - name: Checkout main run: git checkout "main" - # Update "main" package.json to match "next" - - name: Update "main" package.json to match "next" + # Update "main" version to match "next" + - name: Update "main" version to match "next" run: | jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json @@ -89,7 +92,7 @@ jobs: rm temp.json else mv temp.json package.json - git add package.json && git commit -m "Sync next->main package.json" + git add package.json && git commit -m "Sync version to ${{ steps.extract_version.outputs.version }}" fi - name: Perform the merge from next to main diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index d5cb205e..0b6bfd4f 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -33,8 +33,8 @@ jobs: - name: Checkout next-major run: git checkout "next-major" - # Update "next-major" package.json to match "next" - - name: Update "next-major" package.json to match "next" + # Update "next-major" version to match "next" + - name: Update "next-major" version to match "next" run: | jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json @@ -82,8 +82,8 @@ jobs: - name: Checkout next-major run: git checkout "next-major" - # Update "next-major" package.json to match "next" - - name: Update "next-major" package.json to match "next" + # Update "next-major" version to match "next" + - name: Update "next-major" version to match "next" run: | jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json @@ -92,7 +92,7 @@ jobs: rm temp.json else mv temp.json package.json - git add package.json && git commit -m "Sync next->next-major package.json" + git add package.json && git commit -m "Sync version to ${{ steps.extract_version.outputs.version }}" fi - name: Perform the merge from next to next-major From 8aab3dfbd347c7027a249a1a91b7640ba7ce612f Mon Sep 17 00:00:00 2001 From: kschrief Date: Wed, 28 Feb 2024 11:48:41 -0500 Subject: [PATCH 30/34] Better commit message --- .github/workflows/merge-to-main.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/merge-to-main.yml b/.github/workflows/merge-to-main.yml index aaee22f0..d80d699f 100644 --- a/.github/workflows/merge-to-main.yml +++ b/.github/workflows/merge-to-main.yml @@ -1,9 +1,6 @@ name: Attempt to merge next to main on: workflow_dispatch: - push: - branches: - - "next" jobs: # Check if next can merge into main From 3b81a54cbef281b5792f6061f0e3faa01889fea3 Mon Sep 17 00:00:00 2001 From: kschrief Date: Fri, 8 Mar 2024 10:52:06 -0500 Subject: [PATCH 31/34] Reverse temporary changes --- .github/workflows/release.yml | 38 +++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..1e13808a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: Release to GitHub and NPM +on: + workflow_dispatch: + push: + branches: + - 'main' + - 'next' +env: + HUSKY: 0 +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + repo-token: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} + persist-credentials: false + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 'lts/*' + - name: Set explicit npm dist-tag default + if: github.ref_name == 'main' + run: echo "NPM_DIST_TAG=latest" >> $GITHUB_ENV + - name: Override npm dist-tag for non-main releases + if: github.ref_name != 'main' + run: echo "NPM_DIST_TAG=${{ github.ref_name }}" >> $GITHUB_ENV + - name: Install dependencies + run: npm ci + - name: Release to GitHub and NPM + env: + GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} # <-- Allows semantic-release-bot to push changes to protected branches + NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }} # <-- Allows semantic-release to publish to npm without 2 factor auth. + npm_config_tag: ${{ env.NPM_DIST_TAG }} # <-- For main, this is `latest.` Otherwise, `next`, `next-major`, etc. See ./.releaserc for release branch config. + run: npx semantic-release diff --git a/package.json b/package.json index 87facaa5..cafd1855 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@firebolt-js/openrpc", - "version": "2.3.0-next.3", + "version": "2.3.0-next.1", "description": "The Firebolt SDK Code & Doc Generator", "main": "languages/javascript/src/sdk.mjs", "type": "module", From 40c70b66e5cdba48038510ffa93cfdeaad20fc01 Mon Sep 17 00:00:00 2001 From: kschrief Date: Mon, 25 Mar 2024 10:48:56 -0400 Subject: [PATCH 32/34] Reverse versioning override --- .github/workflows/merge-to-main.yml | 36 ------------------- .github/workflows/merge-to-next-major.yml | 44 ++++++++++++++--------- 2 files changed, 28 insertions(+), 52 deletions(-) diff --git a/.github/workflows/merge-to-main.yml b/.github/workflows/merge-to-main.yml index d80d699f..edbc5ea1 100644 --- a/.github/workflows/merge-to-main.yml +++ b/.github/workflows/merge-to-main.yml @@ -21,28 +21,10 @@ jobs: git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}" git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}" - # Get the "next" version number - - name: Extract next version - id: extract_version - run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')" - # Checkout "main" - name: Checkout main run: git checkout "main" - # Update "main" version to match "next" - - name: Update "main" version to match "next" - 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 - # Attempt a dry-run merge - name: Attempt a dry-run merge run: | @@ -70,28 +52,10 @@ jobs: git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}" git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}" - # Get the "next" version number - - name: Extract next version - id: extract_version - run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')" - # Checkout "main" - name: Checkout main run: git checkout "main" - # Update "main" version to match "next" - - name: Update "main" version to match "next" - 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 - - name: Perform the merge from next to main run: | git merge origin/next diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 0b6bfd4f..955fc2df 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -24,17 +24,21 @@ jobs: git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}" git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}" - # Get the "next" version number - - name: Extract next version - id: extract_version - run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')" - # Checkout "next-major" - name: Checkout next-major run: git checkout "next-major" - # Update "next-major" version to match "next" - - name: Update "next-major" version to match "next" + # 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 @@ -46,10 +50,14 @@ jobs: 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" + # Attempt a dry-run merge - name: Attempt a dry-run merge run: | - git merge --no-commit --no-ff origin/${{github.ref_name}} + git merge --no-commit --no-ff ${{github.ref_name}} exit $? # Attempt to merge to next-major if our dry-run succeeded @@ -73,17 +81,21 @@ jobs: git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}" git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}" - # Get the "next" version number - - name: Extract next version - id: extract_version - run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')" - # Checkout "next-major" - name: Checkout next-major run: git checkout "next-major" - # Update "next-major" version to match "next" - - name: Update "next-major" version to match "next" + # 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 @@ -97,7 +109,7 @@ jobs: - name: Perform the merge from next to next-major run: | - git merge origin/next + git merge next merge_status=$? git push origin "next-major" From 5ebcecc7fff14e1802e3135f9fd845aabd58f299 Mon Sep 17 00:00:00 2001 From: kschrief Date: Mon, 25 Mar 2024 10:51:43 -0400 Subject: [PATCH 33/34] Silly change --- .github/workflows/merge-to-main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-to-main.yml b/.github/workflows/merge-to-main.yml index edbc5ea1..02f60a45 100644 --- a/.github/workflows/merge-to-main.yml +++ b/.github/workflows/merge-to-main.yml @@ -71,7 +71,7 @@ jobs: exit 1 fi - # If the merge cannot be performed, let stakeholders know + # If the merge cannot be performed, let stakeholders know process_merge_on_failure: name: Merge dry-run failure needs: check_merge From 2ca3e707f3c4277ca54536300c8fc5e6a4215fca Mon Sep 17 00:00:00 2001 From: kschrief Date: Mon, 25 Mar 2024 10:56:40 -0400 Subject: [PATCH 34/34] Forgot to checkout next-major --- .github/workflows/merge-to-next-major.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/merge-to-next-major.yml b/.github/workflows/merge-to-next-major.yml index 955fc2df..34d8ecea 100644 --- a/.github/workflows/merge-to-next-major.yml +++ b/.github/workflows/merge-to-next-major.yml @@ -107,6 +107,10 @@ jobs: 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