Skip to content

Commit

Permalink
Add script to bump framework versions, bump coingecko (#2276)
Browse files Browse the repository at this point in the history
Co-authored-by: amit-momin <108959691+amit-momin@users.noreply.github.com>
  • Loading branch information
alejoberardino and amit-momin authored Oct 26, 2022
1 parent a2cae21 commit 4972b1f
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 27 deletions.
5 changes: 5 additions & 0 deletions .changeset/khaki-fishes-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chainlink/coingecko-test-adapter': patch
---

Bump framework version
36 changes: 18 additions & 18 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"qa:dependencies": "ts-node-transpile-only ./packages/scripts/src/adapter-dependencies",
"get-changed-adapters": "ts-node-transpile-only ./packages/scripts/src/get-changed-adapters",
"validate-codecov": "curl --data-binary @codecov.yml https://codecov.io/validate",
"get-release-notes": "ts-node-transpile-only ./packages/scripts/src/get-release-notes"
"get-release-notes": "ts-node-transpile-only ./packages/scripts/src/get-release-notes",
"framework-bump": "./packages/scripts/src/framework/version-bump.sh"
},
"dependencies": {
"@babel/core": "7.18.13",
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@apidevtools/json-schema-ref-parser": "9.0.9",
"@chainlink/ea-bootstrap": "workspace:*",
"@chainlink/ea-factories": "workspace:*",
"@chainlink/external-adapter-framework": "0.5.1",
"@chainlink/external-adapter-framework": "0.5.2",
"airtable": "0.11.4",
"axios": "0.22.0",
"axios-mock-adapter": "1.20.0",
Expand Down
56 changes: 56 additions & 0 deletions packages/scripts/src/framework/version-bump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

function bump() (
cd $1

# Get current version
current_version=$(jq -r '.dependencies."@chainlink/external-adapter-framework"' package.json)
# Install latest version, pinned
yarn add @chainlink/external-adapter-framework -E > /dev/null # Silence output
latest_version=$(jq -r '.dependencies."@chainlink/external-adapter-framework"' package.json) # Get final version

if [[ $current_version == $latest_version ]] ; then
echo "Package $1 already at latest version $latest_version"
else
echo "Bumped framework version in package $1 from version $current_version to version $latest_version"
fi
)

cd packages

if [[ -z "${NPM_AUTH_TOKEN}" ]]; then
echo "The NPM_AUTH_TOKEN variable needs to be set"
exit 1
fi

# This will cause changes to .yarnrc.yml, so we'll need to remove them later
yarn config set npmAuthToken $NPM_AUTH_TOKEN

if [[ -n "$1" ]]; then
# Run bump only for one package
if jq -e 'if (.dependencies."@chainlink/external-adapter-framework" != null) then true else false end' "sources/${1}/package.json" > /dev/null ; then
echo "Will only bump framework version for package sources/$1"
bump "sources/$1"
else
echo "Package $1 does not exist or use EA v3"
fi
else
echo "Bumping versions for all available source packages and scripts"
bump scripts/

for d in sources/* ; do
if [[ $d == "sources/README.md" ]] ; then
continue
fi

if jq -e 'if (.dependencies."@chainlink/external-adapter-framework" != null) then true else false end' "${d}/package.json" > /dev/null ; then
bump "$d"
fi
done
fi

cd ..

# Remove the auth token from .yarnrc to avoid leaking tokens
git restore .yarnrc.yml

2 changes: 1 addition & 1 deletion packages/sources/coingecko-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"test": "jest"
},
"dependencies": {
"@chainlink/external-adapter-framework": "0.5.1",
"@chainlink/external-adapter-framework": "0.5.2",
"tslib": "^2.3.1"
},
"devDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2204,7 +2204,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@chainlink/coingecko-test-adapter@workspace:packages/sources/coingecko-test"
dependencies:
"@chainlink/external-adapter-framework": 0.5.1
"@chainlink/external-adapter-framework": 0.5.2
"@types/jest": 27.5.2
"@types/node": 16.11.51
"@types/supertest": 2.0.12
Expand Down Expand Up @@ -2781,7 +2781,7 @@ __metadata:
"@apidevtools/json-schema-ref-parser": 9.0.9
"@chainlink/ea-bootstrap": "workspace:*"
"@chainlink/ea-factories": "workspace:*"
"@chainlink/external-adapter-framework": 0.5.1
"@chainlink/external-adapter-framework": 0.5.2
"@types/command-line-args": 5.2.0
"@types/command-line-usage": 5.0.2
"@types/jest": 27.5.2
Expand Down Expand Up @@ -3207,9 +3207,9 @@ __metadata:
languageName: unknown
linkType: soft

"@chainlink/external-adapter-framework@npm:0.5.1":
version: 0.5.1
resolution: "@chainlink/external-adapter-framework@npm:0.5.1"
"@chainlink/external-adapter-framework@npm:0.5.2":
version: 0.5.2
resolution: "@chainlink/external-adapter-framework@npm:0.5.2"
dependencies:
ajv: 8.11.0
axios: 0.27.2
Expand All @@ -3219,7 +3219,7 @@ __metadata:
pino: 8.6.1
prom-client: 13.2.0
ws: 8.9.0
checksum: b002289fc537a918d25a76a34a7510038141ec040ea404e60edb6b1c777d3d6a4970fdfafe93d8cf24ea2b0d6f9bfae0ea4f17bd7a322750d9b3808841b3deee
checksum: 4af5f395c455645d44f552c9bba285fdc8b1a8f558fcded6fd8281a5522c98ef5d5aa4616ceb915612f3f5f065a68dc54c4093cde6e71dab2fec5329f57bcc96
languageName: node
linkType: hard

Expand Down

0 comments on commit 4972b1f

Please sign in to comment.