From 350665d0f9e8308cbcec64ebf26caee198749e82 Mon Sep 17 00:00:00 2001 From: Kendra Neil <53584728+TheRealAmazonKendra@users.noreply.github.com> Date: Mon, 13 Feb 2023 19:04:01 -0800 Subject: [PATCH] chore(actions): fix yarn upgrade scripts (#24148) `set-output` is deprecated and we can use lerna instead of `buildup`. Also, the scripts were failing on lerna commands due to a missing dependency `js-yaml`. I've added that as well. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .github/workflows/yarn-upgrade-v1main.yml | 11 +++++------ .github/workflows/yarn-upgrade.yml | 5 ++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/yarn-upgrade-v1main.yml b/.github/workflows/yarn-upgrade-v1main.yml index 8d66e4f338193..563a97fa19e12 100644 --- a/.github/workflows/yarn-upgrade-v1main.yml +++ b/.github/workflows/yarn-upgrade-v1main.yml @@ -26,7 +26,7 @@ jobs: - name: Locate Yarn cache id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - name: Restore Yarn cache uses: actions/cache@v3 @@ -39,17 +39,16 @@ jobs: run: yarn install --frozen-lockfile - name: Install Tools run: |- - npm -g install lerna npm-check-updates@^9.0.0 + npm -g install lerna js-yaml npm-check-updates@^9.0.0 - name: Build CLI - run: cd packages/aws-cdk && ../../scripts/buildup + run: lerna run build --scope aws-cdk --include-dependencies --stream - name: Build Integ Runner - run: cd packages/@aws-cdk/integ-runner && ../../../scripts/buildup + run: lerna run build --scope @aws-cdk/integ-runner --include-dependencies --stream - name: List Mono-Repo Packages id: list-packages # These need to be ignored from the `ncu` runs! run: |- - echo -n "::set-output name=list::" - node -p "$(lerna ls --all --json 2>/dev/null).map(item => item.name).join(',')" + echo "list=$(lerna ls --all --json 2>/dev/null | jq -r 'map(.name) | join(",")')" >> $GITHUB_OUTPUT - name: Run "ncu -u" # We special-case some @types because they need to be pinned to specific versions due to breaking changes in minor upgrades https://github.com/DefinitelyTyped/DefinitelyTyped/issues/64266 # We special-case aws-sdk because of breaking changes with TS interface exports in recent minor versions - https://github.com/aws/aws-sdk-js/issues/3453 diff --git a/.github/workflows/yarn-upgrade.yml b/.github/workflows/yarn-upgrade.yml index 46e4c57f6ffd0..b4a5ccc6bb1ea 100644 --- a/.github/workflows/yarn-upgrade.yml +++ b/.github/workflows/yarn-upgrade.yml @@ -37,14 +37,13 @@ jobs: run: yarn install --frozen-lockfile - name: Install Tools run: |- - npm -g install lerna npm-check-updates@^9.0.0 + npm -g install lerna js-yaml npm-check-updates@^9.0.0 - name: Build Integ Runner - run: cd packages/@aws-cdk/integ-runner && ../../../scripts/buildup + run: lerna run build --scope @aws-cdk/integ-runner --include-dependencies - name: List Mono-Repo Packages id: list-packages # These need to be ignored from the `ncu` runs! run: |- - echo -n "::set-output name=list::" echo "list=$(lerna ls --all --json 2>/dev/null | jq -r 'map(.name) | join(",")')" >> $GITHUB_OUTPUT - name: Run "ncu -u" # We special-case some @types because they need to be pinned to specific versions due to breaking changes in minor upgrades https://github.com/DefinitelyTyped/DefinitelyTyped/issues/64266