diff --git a/.github/workflows/alpha-npm.yml b/.github/workflows/alpha-npm.yml index 3a905ab9e..f70e8691e 100644 --- a/.github/workflows/alpha-npm.yml +++ b/.github/workflows/alpha-npm.yml @@ -63,10 +63,13 @@ jobs: node ./scripts/bump-workspace.mjs --prerelease=$ALPHA_PRERELEASE shell: bash - - name: Build all workspace packages + - name: Make build script executable + run: chmod +x ./scripts/build-workspace.sh + + - name: Build all workspace packages sequentially env: NODE_AUTH_TOKEN: ${{secrets.npm_token}} - run: pnpm --recursive --stream build + run: ./scripts/build-workspace.sh - name: Publish selected @web5/* packages env: diff --git a/scripts/build-sequentially.sh b/scripts/build-sequentially.sh new file mode 100755 index 000000000..4b3ad047c --- /dev/null +++ b/scripts/build-sequentially.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Array of folders to loop through +folders=( + "packages/crypto" + "packages/crypto-aws-kms" + "packages/common" + "packages/dids" + "packages/credentials" + "packages/agent" + "packages/identity-agent" + "packages/proxy-agent" + "packages/user-agent" + "packages/api" +) + +# Get the directory of the script +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +# Navigate to the root directory (assumes the script is in /scripts/) +root_dir="$(dirname "$script_dir")" +cd "$root_dir" || { echo "Failed to navigate to root directory"; exit 1; } + +# Loop through each folder +for folder in "${folders[@]}"; do + echo "Building in $folder" + cd "$folder" || { echo "Failed to navigate to $folder"; exit 1; } + pnpm build || { echo "Build failed in $folder"; exit 1; } + cd "$root_dir" # Return to the root directory +done + +echo "All builds completed successfully." \ No newline at end of file