From 4fc67ca6f8dea4917a26d153c7c5b1af4c2bb4ef Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Tue, 27 Aug 2024 14:50:59 -0400 Subject: [PATCH] pnpm build in workflow instead of script file --- .github/workflows/alpha-npm.yml | 14 +++++++++----- scripts/build-sequentially.sh | 32 -------------------------------- 2 files changed, 9 insertions(+), 37 deletions(-) delete mode 100755 scripts/build-sequentially.sh diff --git a/.github/workflows/alpha-npm.yml b/.github/workflows/alpha-npm.yml index f70e8691e..a722ea5fd 100644 --- a/.github/workflows/alpha-npm.yml +++ b/.github/workflows/alpha-npm.yml @@ -21,7 +21,8 @@ jobs: env: # Packages not listed here will be excluded from publishing - PACKAGES: "agent api common credentials crypto crypto-aws-kms dids identity-agent proxy-agent user-agent" + # These are currently in a specific order due to dependency requirements + PACKAGES: "crypto crypto-aws-kms common dids credentials agent identity-agent proxy-agent user-agent api" steps: - name: Checkout source @@ -63,13 +64,16 @@ jobs: node ./scripts/bump-workspace.mjs --prerelease=$ALPHA_PRERELEASE shell: bash - - 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: ./scripts/build-workspace.sh + run: | + for package in $PACKAGES; do + cd packages/$package + pnpm build + cd ../.. + done + shell: bash - name: Publish selected @web5/* packages env: diff --git a/scripts/build-sequentially.sh b/scripts/build-sequentially.sh deleted file mode 100755 index 4b3ad047c..000000000 --- a/scripts/build-sequentially.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/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