Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions packages/scripts/src/framework/version-bump.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env bash -e

LATEST_VERSION=$(npm view @chainlink/external-adapter-framework version)''

Expand Down Expand Up @@ -56,13 +56,22 @@ echo "Running yarn..."
yarn > /dev/null

if [ -s changed_eas.tmp ]; then
# Generate changeset (manually for now, since the changesets CLI has no options to automate this part)
changeset_name="$(cd packages/scripts && yarn node -e 'console.log(require("human-id").humanId({ separator: "-", capitalize: false }))').md"
echo "Creating changeset ($changeset_name)..."
touch .changeset/$changeset_name
echo "---" >> .changeset/$changeset_name
cat changed_eas.tmp >> .changeset/$changeset_name
printf -- '---\n\nBumped framework version\n' >> .changeset/$changeset_name
# We create a separate changeset file for each package so we don't enforce
# releasing all packages at the same time.
mapfile -t changeset_lines < changed_eas.tmp
count=${#changeset_lines[@]}
# Create changeset names with a single call to yarn node as calling it 100+
# times is quite slow.
mapfile -t changeset_names < <(cd packages/scripts && yarn node -e "
const { humanId } = require('human-id')
for (let i = 0; i < $count; i++) console.log(humanId({ separator: '-', capitalize: false }))
")
for i in "${!changeset_lines[@]}"; do
# Generate changeset (manually for now, since the changesets CLI has no options to automate this part)
changeset_filename="${changeset_names[$i]}.md"
echo "Creating changeset ($changeset_filename)..."
printf '%s\n%s\n%s\n\nBumped framework version\n' "---" "${changeset_lines[$i]}" "---" > ".changeset/$changeset_filename"
done
else
echo "No adapters were changed, no need to create a changeset."
fi
Expand Down
Loading