From b79559b130df2d407acd12e7f7635f1d819f786d Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Fri, 8 Aug 2025 11:42:36 +0200 Subject: [PATCH 01/12] Copy rkflows/upsert-release-pr.yml --- .github/workflows/release-individual.yml | 113 +++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 .github/workflows/release-individual.yml diff --git a/.github/workflows/release-individual.yml b/.github/workflows/release-individual.yml new file mode 100644 index 0000000000..55e210fff6 --- /dev/null +++ b/.github/workflows/release-individual.yml @@ -0,0 +1,113 @@ +name: Upsert Release PR + +on: + push: + branches: + - main + # The only commits that will contain changes to the masterlist will be releases + paths-ignore: + - 'MASTERLIST.md' + - 'package.json' + - '.changeset/**' + - 'packages/**/CHANGELOG.md' + - 'packages/**/README.md' + - 'packages/**/package.json' + workflow_dispatch: + inputs: + # For this workflow, BUILD_ALL will only affect the generate documentation step + build-all: + description: whether to run steps for all adapters, regardless of whether they were changed in this event + required: false + default: 'false' + +# TODO: This entire workflow would be immensely sped up (~3min -> 30s tops) if: +# - Readme generation did not require built TS files +# - Readme generation was optimized a bit +# - We only installed the changeset package + +jobs: + consume-changesets: + name: Upsert Release PR + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + UPSTREAM_BRANCH: 'HEAD~1' + BUILD_ALL: ${{ github.event.inputs.build-all }} + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits + fetch-depth: 0 + # We install only the changesets tool so we can do the mock changesets before installing dependencies, + # as the setup action will only build the files relevant to the changed adapters + - name: Install changesets tool + run: | + yarn add @changesets/cli@$(jq -r '.devDependencies."@changesets/cli"' package.json) + - name: Configure git + shell: bash + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + - name: Temporarily calculate changesets to generate readmes with proper versions + run: | + yarn changeset version + git add -A + git commit -m "Changesets mock" + - name: Set up and install dependencies + uses: ./.github/actions/setup + with: + base-branch: ${{ env.UPSTREAM_BRANCH }} + # We want to build all packages for the documentation generation step so that the Masterlist is up to date for all EAs + build-all: 'true' + - name: Increase monorepo version + run: | + BUMPED_VERSION=$(jq -r '.version | split(".")[1] | tonumber | . + 1 | tostring | "1." + . + ".0"' package.json) + jq ".version = \"$BUMPED_VERSION\"" package.json > package.tmp.json + mv package.tmp.json package.json + echo "BUMPED_VERSION=$BUMPED_VERSION" >> $GITHUB_ENV + - name: Generate documentation + run: | + yarn generate:master-list -v + yarn generate:readme -v + - name: Undo temporary changesets and commit docs + run: | + git stash + git reset HEAD^ --hard + git stash pop + - name: Commit docs + run: | + git add MASTERLIST.md + git add "*README.md" + yarn lint-staged + - name: Stash changes for changesets action to pick up in custom script + run: | + git stash + - name: Create Release Pull Request + uses: smartcontractkit/.github/actions/signed-commits@4b7aa1d5b60f0d5704400a1d2b192905ad386e6c # changesets-signed-commits@1.2.4 + with: + # This version command is not only necessary because of yarn pnp, but because the changeset action + # performs git resets and we want to keep those changes, so we stash and then pop them here. + # All the previous steps would technically make more sense in the script itself, but we + # keep them as separate ones so it's easier to see them from the github UI to debug. + version: ./.github/scripts/run-changesets.sh + title: 'Release ${{ env.BUMPED_VERSION }}' + commit: 'Release ${{ env.BUMPED_VERSION }}' + - name: Tag changesets commit + run: | + # Delete the tags if they already exist (ignore errors if they don't) + git tag -d "v$BUMPED_VERSION" || true + git push --delete origin "v$BUMPED_VERSION" || true + git tag "v$BUMPED_VERSION" + git push origin "v$BUMPED_VERSION" + # Because the workflows won't run and we technically don't need them for this autogenerated PR, + # we manually skip all the required checks by using the GitHub API directly. + - name: Skip required checks manually + run: | + COMMIT_SHA=$(git rev-parse HEAD) + ./.github/scripts/skip-check.sh $COMMIT_SHA "Adapter changes accompanied by a changeset" + ./.github/scripts/skip-check.sh $COMMIT_SHA "Documentation generation test" + ./.github/scripts/skip-check.sh $COMMIT_SHA "Install and verify dependencies" + ./.github/scripts/skip-check.sh $COMMIT_SHA "Run integration tests for changed adapters" + ./.github/scripts/skip-check.sh $COMMIT_SHA "Run linters and formatters" + ./.github/scripts/skip-check.sh $COMMIT_SHA "Run unit tests for changed adapters" From a2e4bedfdf1ef5987cbaeb821f9c9b5427b60a04 Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Fri, 8 Aug 2025 11:56:33 +0200 Subject: [PATCH 02/12] add workflow --- .github/scripts/packages-to-ignore.sh | 12 ++++++ .github/scripts/run-changesets.sh | 4 +- .github/workflows/release-individual.yml | 51 +++++++++--------------- 3 files changed, 33 insertions(+), 34 deletions(-) create mode 100755 .github/scripts/packages-to-ignore.sh diff --git a/.github/scripts/packages-to-ignore.sh b/.github/scripts/packages-to-ignore.sh new file mode 100755 index 0000000000..f38bcde4fd --- /dev/null +++ b/.github/scripts/packages-to-ignore.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail + + +eas_to_include="$(echo "$*" | sed -e 's/ *, */ /g' | tr ' ' '\n')" +packages_to_include="$(echo "$eas_to_include" | tr ' ' '\n' | sed -e 's|.*|@chainlink/&-adapter|')" + +all_packages=$(yarn workspaces list --json | jq -r '.name' | grep -v '@chainlink/external-adapters-js') + +packages_to_ignore="$(echo "$all_packages" | grep -vFf <(echo "$packages_to_include" | tr ' ' '\n'))" + +echo "$packages_to_ignore" diff --git a/.github/scripts/run-changesets.sh b/.github/scripts/run-changesets.sh index 0b1503a32d..d12f676a76 100755 --- a/.github/scripts/run-changesets.sh +++ b/.github/scripts/run-changesets.sh @@ -1,7 +1,7 @@ #!/bin/bash -e # Run changesets -yarn changeset version +yarn changeset version "$@" # Recover all our changes (readmes, version bump) -git stash pop \ No newline at end of file +git stash pop diff --git a/.github/workflows/release-individual.yml b/.github/workflows/release-individual.yml index 55e210fff6..bb53411d6f 100644 --- a/.github/workflows/release-individual.yml +++ b/.github/workflows/release-individual.yml @@ -1,29 +1,13 @@ -name: Upsert Release PR +name: Release individual adapters + +# Creates PRs in external-adapters-js and infra-k8s to release individually selected adapters. on: - push: - branches: - - main - # The only commits that will contain changes to the masterlist will be releases - paths-ignore: - - 'MASTERLIST.md' - - 'package.json' - - '.changeset/**' - - 'packages/**/CHANGELOG.md' - - 'packages/**/README.md' - - 'packages/**/package.json' workflow_dispatch: inputs: - # For this workflow, BUILD_ALL will only affect the generate documentation step - build-all: - description: whether to run steps for all adapters, regardless of whether they were changed in this event - required: false - default: 'false' - -# TODO: This entire workflow would be immensely sped up (~3min -> 30s tops) if: -# - Readme generation did not require built TS files -# - Readme generation was optimized a bit -# - We only installed the changeset package + adapters: + description: Comma-separated list of adapter names to release + required: true jobs: consume-changesets: @@ -31,8 +15,7 @@ jobs: runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - UPSTREAM_BRANCH: 'HEAD~1' - BUILD_ALL: ${{ github.event.inputs.build-all }} + UPSTREAM_BRANCH: 'main' steps: - name: Checkout Repo uses: actions/checkout@v4 @@ -49,16 +32,20 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" + - name: Set CHANGESET_IGNORE_ARGS env var + run: | + CHANGESET_IGNORE_ARGS="$(.github/scripts/packages-to-ignore.sh ${{ github.event.inputs.adapters }} | sed -e 's/^/--ignore /')" + echo "CHANGESET_IGNORE_ARGS=$CHANGESET_IGNORE_ARGS" >> $GITHUB_ENV - name: Temporarily calculate changesets to generate readmes with proper versions run: | - yarn changeset version + # Get from output of previous step: + PACKAGES_TO_IGNORE="${{ env.packages_to_ignore }}" + yarn changeset version $CHANGESET_IGNORE_ARGS git add -A git commit -m "Changesets mock" - name: Set up and install dependencies uses: ./.github/actions/setup with: - base-branch: ${{ env.UPSTREAM_BRANCH }} - # We want to build all packages for the documentation generation step so that the Masterlist is up to date for all EAs build-all: 'true' - name: Increase monorepo version run: | @@ -90,16 +77,16 @@ jobs: # performs git resets and we want to keep those changes, so we stash and then pop them here. # All the previous steps would technically make more sense in the script itself, but we # keep them as separate ones so it's easier to see them from the github UI to debug. - version: ./.github/scripts/run-changesets.sh + version: ./.github/scripts/run-changesets.sh ${{ env.CHANGESET_IGNORE_ARGS }} title: 'Release ${{ env.BUMPED_VERSION }}' commit: 'Release ${{ env.BUMPED_VERSION }}' - name: Tag changesets commit run: | # Delete the tags if they already exist (ignore errors if they don't) - git tag -d "v$BUMPED_VERSION" || true - git push --delete origin "v$BUMPED_VERSION" || true - git tag "v$BUMPED_VERSION" - git push origin "v$BUMPED_VERSION" + #git tag -d "v$BUMPED_VERSION" || true + #git push --delete origin "v$BUMPED_VERSION" || true + #git tag "v$BUMPED_VERSION" + #git push origin "v$BUMPED_VERSION" # Because the workflows won't run and we technically don't need them for this autogenerated PR, # we manually skip all the required checks by using the GitHub API directly. - name: Skip required checks manually From 1816fb19e1cea0fabebd5c91adc292e4b4dc8ca4 Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Fri, 8 Aug 2025 11:59:52 +0200 Subject: [PATCH 03/12] Fake changesets for testing --- .changeset/new-starfishes-fetch.md | 5 +++++ .changeset/nice-chefs-deliver.md | 5 +++++ .changeset/tall-roses-peel.md | 5 +++++ 3 files changed, 15 insertions(+) create mode 100644 .changeset/new-starfishes-fetch.md create mode 100644 .changeset/nice-chefs-deliver.md create mode 100644 .changeset/tall-roses-peel.md diff --git a/.changeset/new-starfishes-fetch.md b/.changeset/new-starfishes-fetch.md new file mode 100644 index 0000000000..fbd1617df9 --- /dev/null +++ b/.changeset/new-starfishes-fetch.md @@ -0,0 +1,5 @@ +--- +'@chainlink/cmeth-adapter': minor +--- + +testing workflow diff --git a/.changeset/nice-chefs-deliver.md b/.changeset/nice-chefs-deliver.md new file mode 100644 index 0000000000..4b1496df69 --- /dev/null +++ b/.changeset/nice-chefs-deliver.md @@ -0,0 +1,5 @@ +--- +'@chainlink/token-balance-adapter': minor +--- + +testing workflow diff --git a/.changeset/tall-roses-peel.md b/.changeset/tall-roses-peel.md new file mode 100644 index 0000000000..e97a95e891 --- /dev/null +++ b/.changeset/tall-roses-peel.md @@ -0,0 +1,5 @@ +--- +'@chainlink/aleno-adapter': minor +--- + +testing workflow From 46d7251a3aec5dfc32cb3c551d066473064e078a Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Fri, 8 Aug 2025 12:00:46 +0200 Subject: [PATCH 04/12] Add testing to PR title --- .github/workflows/release-individual.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-individual.yml b/.github/workflows/release-individual.yml index bb53411d6f..021f90830c 100644 --- a/.github/workflows/release-individual.yml +++ b/.github/workflows/release-individual.yml @@ -78,8 +78,8 @@ jobs: # All the previous steps would technically make more sense in the script itself, but we # keep them as separate ones so it's easier to see them from the github UI to debug. version: ./.github/scripts/run-changesets.sh ${{ env.CHANGESET_IGNORE_ARGS }} - title: 'Release ${{ env.BUMPED_VERSION }}' - commit: 'Release ${{ env.BUMPED_VERSION }}' + title: 'testing Release ${{ env.BUMPED_VERSION }}' + commit: 'testing Release ${{ env.BUMPED_VERSION }}' - name: Tag changesets commit run: | # Delete the tags if they already exist (ignore errors if they don't) From d292ef1d081dfe43ce84c9fdd4afadd5b2a3c6f9 Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Fri, 8 Aug 2025 12:05:07 +0200 Subject: [PATCH 05/12] Change upsert workflow for testing --- .github/workflows/upsert-release-pr.yml | 53 ++++++++++--------------- 1 file changed, 20 insertions(+), 33 deletions(-) diff --git a/.github/workflows/upsert-release-pr.yml b/.github/workflows/upsert-release-pr.yml index 55e210fff6..8bb20e7ade 100644 --- a/.github/workflows/upsert-release-pr.yml +++ b/.github/workflows/upsert-release-pr.yml @@ -1,29 +1,13 @@ name: Upsert Release PR +# Creates PRs in external-adapters-js and infra-k8s to release individually selected adapters. + on: - push: - branches: - - main - # The only commits that will contain changes to the masterlist will be releases - paths-ignore: - - 'MASTERLIST.md' - - 'package.json' - - '.changeset/**' - - 'packages/**/CHANGELOG.md' - - 'packages/**/README.md' - - 'packages/**/package.json' workflow_dispatch: inputs: - # For this workflow, BUILD_ALL will only affect the generate documentation step - build-all: - description: whether to run steps for all adapters, regardless of whether they were changed in this event - required: false - default: 'false' - -# TODO: This entire workflow would be immensely sped up (~3min -> 30s tops) if: -# - Readme generation did not require built TS files -# - Readme generation was optimized a bit -# - We only installed the changeset package + adapters: + description: Comma-separated list of adapter names to release + required: true jobs: consume-changesets: @@ -31,8 +15,7 @@ jobs: runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - UPSTREAM_BRANCH: 'HEAD~1' - BUILD_ALL: ${{ github.event.inputs.build-all }} + UPSTREAM_BRANCH: 'main' steps: - name: Checkout Repo uses: actions/checkout@v4 @@ -49,16 +32,20 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" + - name: Set CHANGESET_IGNORE_ARGS env var + run: | + CHANGESET_IGNORE_ARGS="$(.github/scripts/packages-to-ignore.sh ${{ github.event.inputs.adapters }} | sed -e 's/^/--ignore /')" + echo "CHANGESET_IGNORE_ARGS=$CHANGESET_IGNORE_ARGS" >> $GITHUB_ENV - name: Temporarily calculate changesets to generate readmes with proper versions run: | - yarn changeset version + # Get from output of previous step: + PACKAGES_TO_IGNORE="${{ env.packages_to_ignore }}" + yarn changeset version $CHANGESET_IGNORE_ARGS git add -A git commit -m "Changesets mock" - name: Set up and install dependencies uses: ./.github/actions/setup with: - base-branch: ${{ env.UPSTREAM_BRANCH }} - # We want to build all packages for the documentation generation step so that the Masterlist is up to date for all EAs build-all: 'true' - name: Increase monorepo version run: | @@ -90,16 +77,16 @@ jobs: # performs git resets and we want to keep those changes, so we stash and then pop them here. # All the previous steps would technically make more sense in the script itself, but we # keep them as separate ones so it's easier to see them from the github UI to debug. - version: ./.github/scripts/run-changesets.sh - title: 'Release ${{ env.BUMPED_VERSION }}' - commit: 'Release ${{ env.BUMPED_VERSION }}' + version: ./.github/scripts/run-changesets.sh ${{ env.CHANGESET_IGNORE_ARGS }} + title: 'testing Release ${{ env.BUMPED_VERSION }}' + commit: 'testing Release ${{ env.BUMPED_VERSION }}' - name: Tag changesets commit run: | # Delete the tags if they already exist (ignore errors if they don't) - git tag -d "v$BUMPED_VERSION" || true - git push --delete origin "v$BUMPED_VERSION" || true - git tag "v$BUMPED_VERSION" - git push origin "v$BUMPED_VERSION" + #git tag -d "v$BUMPED_VERSION" || true + #git push --delete origin "v$BUMPED_VERSION" || true + #git tag "v$BUMPED_VERSION" + #git push origin "v$BUMPED_VERSION" # Because the workflows won't run and we technically don't need them for this autogenerated PR, # we manually skip all the required checks by using the GitHub API directly. - name: Skip required checks manually From dbbddb8a4321f9abf591a478a0faf165d3eccf82 Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Fri, 8 Aug 2025 12:06:25 +0200 Subject: [PATCH 06/12] Rename upsert workflow for testing --- .github/workflows/upsert-release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upsert-release-pr.yml b/.github/workflows/upsert-release-pr.yml index 8bb20e7ade..e68ee757c5 100644 --- a/.github/workflows/upsert-release-pr.yml +++ b/.github/workflows/upsert-release-pr.yml @@ -1,4 +1,4 @@ -name: Upsert Release PR +name: Upsert Release PR (testing individual release) # Creates PRs in external-adapters-js and infra-k8s to release individually selected adapters. From 690989fa31489648a7236ed4ead9a6ec53fc4a04 Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Fri, 8 Aug 2025 12:12:43 +0200 Subject: [PATCH 07/12] Add quotes around CHANGESET_IGNORE_ARGS when setting GITHUB_ENV --- .github/workflows/release-individual.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-individual.yml b/.github/workflows/release-individual.yml index 021f90830c..25430ca535 100644 --- a/.github/workflows/release-individual.yml +++ b/.github/workflows/release-individual.yml @@ -35,7 +35,7 @@ jobs: - name: Set CHANGESET_IGNORE_ARGS env var run: | CHANGESET_IGNORE_ARGS="$(.github/scripts/packages-to-ignore.sh ${{ github.event.inputs.adapters }} | sed -e 's/^/--ignore /')" - echo "CHANGESET_IGNORE_ARGS=$CHANGESET_IGNORE_ARGS" >> $GITHUB_ENV + echo "CHANGESET_IGNORE_ARGS=\"$CHANGESET_IGNORE_ARGS\"" >> $GITHUB_ENV - name: Temporarily calculate changesets to generate readmes with proper versions run: | # Get from output of previous step: From 9058787fc939ec954c483e62f6b0ea17692800a6 Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Fri, 8 Aug 2025 12:28:26 +0200 Subject: [PATCH 08/12] Make CHANGESET_IGNORE_ARGS a single line --- .github/workflows/release-individual.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-individual.yml b/.github/workflows/release-individual.yml index 25430ca535..aec4c8801a 100644 --- a/.github/workflows/release-individual.yml +++ b/.github/workflows/release-individual.yml @@ -34,8 +34,8 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" - name: Set CHANGESET_IGNORE_ARGS env var run: | - CHANGESET_IGNORE_ARGS="$(.github/scripts/packages-to-ignore.sh ${{ github.event.inputs.adapters }} | sed -e 's/^/--ignore /')" - echo "CHANGESET_IGNORE_ARGS=\"$CHANGESET_IGNORE_ARGS\"" >> $GITHUB_ENV + CHANGESET_IGNORE_ARGS="$(.github/scripts/packages-to-ignore.sh ${{ github.event.inputs.adapters }} | sed -e 's/^/--ignore /' | tr '\n' ' ')" + echo "CHANGESET_IGNORE_ARGS=$CHANGESET_IGNORE_ARGS" >> $GITHUB_ENV - name: Temporarily calculate changesets to generate readmes with proper versions run: | # Get from output of previous step: From 7f8ef735a59f5e37131579f49cf24dfcf6345133 Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Fri, 8 Aug 2025 12:33:11 +0200 Subject: [PATCH 09/12] debug CHANGESET_IGNORE_ARGS GITHUB_ENV --- .github/workflows/release-individual.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release-individual.yml b/.github/workflows/release-individual.yml index aec4c8801a..a0ba049f7e 100644 --- a/.github/workflows/release-individual.yml +++ b/.github/workflows/release-individual.yml @@ -35,7 +35,9 @@ jobs: - name: Set CHANGESET_IGNORE_ARGS env var run: | CHANGESET_IGNORE_ARGS="$(.github/scripts/packages-to-ignore.sh ${{ github.event.inputs.adapters }} | sed -e 's/^/--ignore /' | tr '\n' ' ')" + echo "$CHANGESET_IGNORE_ARGS" echo "CHANGESET_IGNORE_ARGS=$CHANGESET_IGNORE_ARGS" >> $GITHUB_ENV + cat $GITHUB_ENV - name: Temporarily calculate changesets to generate readmes with proper versions run: | # Get from output of previous step: From 559f57f016bfb030085110cc9686225c2f893746 Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Fri, 8 Aug 2025 12:37:29 +0200 Subject: [PATCH 10/12] copy to upsert --- .github/workflows/upsert-release-pr.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upsert-release-pr.yml b/.github/workflows/upsert-release-pr.yml index e68ee757c5..8547c1c9df 100644 --- a/.github/workflows/upsert-release-pr.yml +++ b/.github/workflows/upsert-release-pr.yml @@ -34,8 +34,10 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" - name: Set CHANGESET_IGNORE_ARGS env var run: | - CHANGESET_IGNORE_ARGS="$(.github/scripts/packages-to-ignore.sh ${{ github.event.inputs.adapters }} | sed -e 's/^/--ignore /')" + CHANGESET_IGNORE_ARGS="$(.github/scripts/packages-to-ignore.sh ${{ github.event.inputs.adapters }} | sed -e 's/^/--ignore /' | tr '\n' ' ')" + echo "$CHANGESET_IGNORE_ARGS" echo "CHANGESET_IGNORE_ARGS=$CHANGESET_IGNORE_ARGS" >> $GITHUB_ENV + cat $GITHUB_ENV - name: Temporarily calculate changesets to generate readmes with proper versions run: | # Get from output of previous step: From f4bc330e540389aed7b3b4c678094d08998ba1da Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Fri, 8 Aug 2025 13:18:29 +0200 Subject: [PATCH 11/12] Choose a branch name --- .github/workflows/upsert-release-pr.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/upsert-release-pr.yml b/.github/workflows/upsert-release-pr.yml index 8547c1c9df..5d074f64fb 100644 --- a/.github/workflows/upsert-release-pr.yml +++ b/.github/workflows/upsert-release-pr.yml @@ -72,6 +72,10 @@ jobs: - name: Stash changes for changesets action to pick up in custom script run: | git stash + - name: Choose a branch for the release PR + run: | + BRANCH_NAME=$(echo release-${{ github.event.inputs.adapters }} | tr ',' '-' | sed -e 's/[^a-zA-Z0-9]/-/g') + git checkout -b "$BRANCH_NAME" - name: Create Release Pull Request uses: smartcontractkit/.github/actions/signed-commits@4b7aa1d5b60f0d5704400a1d2b192905ad386e6c # changesets-signed-commits@1.2.4 with: From d66886cf63b794dab14d769b1610e8d438cba40b Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Thu, 4 Sep 2025 19:13:49 +0200 Subject: [PATCH 12/12] stuff --- .changeset/new-starfishes-fetch.md | 5 - .github/scripts/create-release.sh | 22 +++++ .github/scripts/packages-to-ignore.sh | 3 + .pnp.cjs | 8 ++ .../ini-npm-5.0.0-d1ec8350f4-76e5567b46.zip | Bin 0 -> 5644 bytes packages/scripts/package.json | 1 + .../scripts/src/create-release-prs/index.ts | 89 ++++++++++++++++++ packages/sources/cmeth/CHANGELOG.md | 6 ++ packages/sources/cmeth/package.json | 2 +- yarn.lock | 8 ++ 10 files changed, 138 insertions(+), 6 deletions(-) delete mode 100644 .changeset/new-starfishes-fetch.md create mode 100755 .github/scripts/create-release.sh create mode 100644 .yarn/cache/ini-npm-5.0.0-d1ec8350f4-76e5567b46.zip create mode 100644 packages/scripts/src/create-release-prs/index.ts diff --git a/.changeset/new-starfishes-fetch.md b/.changeset/new-starfishes-fetch.md deleted file mode 100644 index fbd1617df9..0000000000 --- a/.changeset/new-starfishes-fetch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@chainlink/cmeth-adapter': minor ---- - -testing workflow diff --git a/.github/scripts/create-release.sh b/.github/scripts/create-release.sh new file mode 100755 index 0000000000..16aad9e3e2 --- /dev/null +++ b/.github/scripts/create-release.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -euo pipefail + +args_to_ignore=() +args_adapters=() + +if [[ -n "${1:-}" ]]; then + eas_to_include="$(echo "$*" | sed -e 's/ *, */ /g' | tr ' ' '\n')" + packages_to_include="$(echo "$eas_to_include" | tr ' ' '\n' | sed -e 's|.*|@chainlink/&-adapter|')" + + all_packages=$(yarn workspaces list --json | jq -r '.name' | grep -v '@chainlink/external-adapters-js') + + args_to_ignore=($(echo "$all_packages" | grep -vFf <(echo "$packages_to_include" | tr ' ' '\n') | sed -e 's|^|--ignore |')) + args_adapters=($(echo "$eas_to_include" | tr ' ' '\n' | sed -e 's|^|--adapters &|')) +fi + +export UPSTREAM_BRANCH=main +yarn changeset version "${args_to_ignore[@]}" +yarn generate:master-list -v +yarn generate:readme -v "${args_adapters[*]}" +git add MASTERLIST.md "*README.md" +yarn lint-staged diff --git a/.github/scripts/packages-to-ignore.sh b/.github/scripts/packages-to-ignore.sh index f38bcde4fd..9a0caa36fc 100755 --- a/.github/scripts/packages-to-ignore.sh +++ b/.github/scripts/packages-to-ignore.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash set -euo pipefail +if [[ -z "${1:-}" ]]; then + exit 0 +fi eas_to_include="$(echo "$*" | sed -e 's/ *, */ /g' | tr ' ' '\n')" packages_to_include="$(echo "$eas_to_include" | tr ' ' '\n' | sed -e 's|.*|@chainlink/&-adapter|')" diff --git a/.pnp.cjs b/.pnp.cjs index e8957f25e4..42f3fe795d 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -6674,6 +6674,7 @@ const RAW_RUNTIME_STATE = ["command-line-args", "npm:5.2.1"],\ ["command-line-usage", "npm:6.1.3"],\ ["human-id", "npm:4.1.1"],\ + ["ini", "npm:5.0.0"],\ ["json-schema-ref-parser", "npm:9.0.9"],\ ["mockserver-client", "npm:5.11.2"],\ ["rxjs", "npm:7.4.0"],\ @@ -25823,6 +25824,13 @@ const RAW_RUNTIME_STATE = ["ini", "npm:2.0.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:5.0.0", {\ + "packageLocation": "./.yarn/cache/ini-npm-5.0.0-d1ec8350f4-76e5567b46.zip/node_modules/ini/",\ + "packageDependencies": [\ + ["ini", "npm:5.0.0"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["inquirer", [\ diff --git a/.yarn/cache/ini-npm-5.0.0-d1ec8350f4-76e5567b46.zip b/.yarn/cache/ini-npm-5.0.0-d1ec8350f4-76e5567b46.zip new file mode 100644 index 0000000000000000000000000000000000000000..8fcd15ec6cee2fe1e61ff142fcb727eb6401b72a GIT binary patch literal 5644 zcmaJ_by!sEw;no%mhJ&jLK;CzdSGa&p}S*fP&%bykdg)|i6I7QX+c6nKvZ%_>5@*b zo^!mvd;Fbq*WS-w-ydte&)Uy^pZ&extEqy4Ne=iK($$}E|5*I>ApDVGuGThYF0R(z z&NiOBn*Ul#`g^GZ%;B$cbO7!j$VnE8&@X5Jz%@DmK>bhUst`E^b!`P*_#7;okNoZ4 zHMwH@^zBs1aEv?p0zS6c;5i1gGJR!!0rkq)*NGdg&LY&k-HbGG+F`D}z6(w$;(aF^+vn9H8O9MojD-ZAu{QxKpy~*ElYqmm&0YeIE*Ebsg6CRY zM%33>8n3Q!Nx_{#t@Oo%HMLJwF4l{}RR-#Ok+Vx=dN@oE)k09;Xkd6e@6k5zQq7$c z)zsyu&;j)=ADl{8%!NNxWcRYgmKM9BCJ&e8YgCfinfEO;K~~pj4Xzi z;C5NyQ^_zJj@H=W-mgnLkKC#rH_J>G+q63GE1w#>T_Pzy&nnx#Bf^m8G#^zppP-UKy*~ds> z8wNL&BgWac-72#S0TnHS2^IBI37!_rwn`_N%?R;507qj`sry+vto-=<7AhI_@8qHQ zCpI`cSpG(!U>r+m6&?UEK?eZ*xc^SgpM3k-@+0#&dZtl3xz2#UwFUJ}^DB?1bIfea z;jEIgvd791+k1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`otye zE;!&h%k7022zjbiymYV580;#95Pv&*VwgAgXlECqNY}p=XA*p^KbC6RW-Kfn(2n|c zI@6w_(nrIV_c-TKPeadxZoFyB*92C6>&?!d&lnnX`4VpuKcL29x}#^VnP5pQRlcfg zI24TfU15sm?=>F7!h6L9X!ER_niQ>wo5a_auh-9*G*!^hr7-^882s_G{Udf{ex~1S z!hdi5X%zm79T~14%fGe$X&e68{!0@4ZXEtQr}n>W#Q$&ppN7+~*padSVMzYh z5P#ZFe;?#`1L_w9V;}pkS^lr&`5o%_4e&ouHAMda Z^}pMprV1AJ&sv-x7wU)JqWa@Y{}0e2_|5 { + try { + // Define CLI options + const commandLineOptions = [ + { + name: 'adapters', + multiple: true, + defaultOption: true, + description: 'Adapters to include in release PRs', + }, + { name: 'help', alias: 'h', type: Boolean, description: 'Display usage guide' }, + ] + const options = commandLineArgs(commandLineOptions) + + // Generate usage guide + if (options.help) { + const usage = commandLineUsage([ + { + header: 'Release PR creation script', + content: + 'This script is run from the root of the external-adapter-js/ repo to create a PR in this repo and another PR in infra-k8s to facilitate the release of a subset of adapters.', + }, + { + header: 'Options', + optionList: commandLineOptions, + }, + { + content: + 'Source code: {underline https://github.com/smartcontractkit/external-adapters-\njs/packages/scripts/src/create-release-prs', + }, + ]) + console.log(usage) + return + } + + const allAdapters = getWorkspaceAdapters() + const adaptersToIgnore = [] + if (options.adapters && options.adapters.length > 0) { + adaptersToIgnore.push(...allAdapters.filter((a) => { + return !options.adapters.includes(a.descopedName) && !options.adapters.includes(a.descopedName.replace(/-adapter$/, '')) + })) + } + const ignoreArgs = adaptersToIgnore.map((a) => `--ignore ${a.name}`).join(' ') + + exec(`yarn changeset version ${ignoreArgs}`, { + fatal: true, + }) + + const awsConfigPath = path.join(process.env.HOME, '.aws', 'config') + const awsConfigText = fs.readFileSync(awsConfigPath).toString() + const awsConfig = ini.parse(awsConfigText) + const awsProfileSdlc = awsConfig['profile sdlc'] + + if (!awsProfileSdlc) { + throw new Error('AWS profile "sdlc" not found in ~/.aws/config') + } + + const sdlcAccountId = + + const imageRepo = + + console.log('dskloetx awsConfig', awsConfig['profile sdlc']) + + // gh workflow run --repo smartcontractkit/infra-k8s --ref main "Infra-k8s Image Dispatcher" -F imageRepos=795953128386.dkr.ecr.us-west-2.amazonaws.com/adapters/cmeth-adapter -F gitRepo=dskloet-test-fake-repo-name + + /* + const testOutput = exec(`yarn test ${this.integrationTestPath}`, { + fatal: true, + silent: true, + env: { ...process.env, ...testEnvOverrides }, + }).toString() + */ + + process.exit(0) + } catch (error) { + console.error({ error: error.message, stack: error.stack }) + process.exit(1) + } +} + +main() diff --git a/packages/sources/cmeth/CHANGELOG.md b/packages/sources/cmeth/CHANGELOG.md index 16d06c9a80..4d08e8104f 100644 --- a/packages/sources/cmeth/CHANGELOG.md +++ b/packages/sources/cmeth/CHANGELOG.md @@ -1,5 +1,11 @@ # @chainlink/cmeth-adapter +## 2.1.0 + +### Minor Changes + +- [`1816fb1`](https://github.com/smartcontractkit/external-adapters-js/commit/1816fb19e1cea0fabebd5c91adc292e4b4dc8ca4) Thanks [@dskloetc](https://github.com/dskloetc)! - testing workflow + ## 2.0.0 ### Major Changes diff --git a/packages/sources/cmeth/package.json b/packages/sources/cmeth/package.json index 6ae3ea6e48..1e4b58088f 100644 --- a/packages/sources/cmeth/package.json +++ b/packages/sources/cmeth/package.json @@ -1,6 +1,6 @@ { "name": "@chainlink/cmeth-adapter", - "version": "2.0.0", + "version": "2.1.0", "description": "Chainlink cmeth adapter.", "keywords": [ "Chainlink", diff --git a/yarn.lock b/yarn.lock index a33cda98d9..a1824f6c0e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3751,6 +3751,7 @@ __metadata: command-line-args: "npm:5.2.1" command-line-usage: "npm:6.1.3" human-id: "npm:4.1.1" + ini: "npm:^5.0.0" json-schema-ref-parser: "npm:9.0.9" mockserver-client: "npm:5.11.2" rxjs: "npm:7.4.0" @@ -20809,6 +20810,13 @@ __metadata: languageName: node linkType: hard +"ini@npm:^5.0.0": + version: 5.0.0 + resolution: "ini@npm:5.0.0" + checksum: 10/76e5567b46504b2b12650878ba6277204500a6ead3fe69eef419ee570456b364b39c040ee545846053f6d8a15797a82fc6d9efe06e392b9b6093935f4a2f2c30 + languageName: node + linkType: hard + "inquirer@npm:^1.0.2": version: 1.2.3 resolution: "inquirer@npm:1.2.3"