From fb265d1a45dea67591e90ac510c501766064c1ff Mon Sep 17 00:00:00 2001 From: Shine Li Date: Tue, 30 Jul 2024 12:51:42 +1000 Subject: [PATCH] fix: DX-3055 deal with browser bundle (#2034) --- .github/workflows/publish.yaml | 13 +++++++------ package.json | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 50f9535545..d5b7dfd863 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -92,23 +92,24 @@ jobs: run: | echo "NEXT_VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT + - name: Typecheck + run: yarn typecheck + + - name: Test + run: yarn test + - name: Update package.json version for build run: | tmp=$(mktemp) jq '.version = "${{steps.version.outputs.NEXT_VERSION}}"' ./sdk/package.json > "$tmp" && mv "$tmp" ./sdk/package.json + # WARNING: build step should be after typecheck and test steps. This is to make sure build artifacts are overwritten by the lint and tests steps. - name: Build run: | export NODE_OPTIONS=--max-old-space-size=6144 && RELEASE_TYPE=${{ env.RELEASE_TYPE }} yarn build ls -l ./sdk/dist/browser/checkout || echo 1 [ -d "./sdk/dist/browser/checkout" ] || { echo "Error: Directory does not exist." && exit 1; } - - name: Typecheck - run: yarn typecheck - - - name: Test - run: yarn test - - name: Push tags # Boolean inputs are not actually booleans, see https://github.com/actions/runner/issues/1483 if: (env.DRY_RUN) == 'false' diff --git a/package.json b/package.json index ffc9270d69..a1546358fa 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "responselike": "^2.0.0" }, "scripts": { - "build": "yarn workspace @imtbl/sdk updateDependencies && NODE_OPTIONS=--max-old-space-size=14366 nx run-many --target=build --projects=@imtbl/sdk --skip-nx-cache && yarn syncpack:format && yarn wsrun -p @imtbl/sdk -a -m copyBrowserBundles", + "build": "yarn workspace @imtbl/sdk updateDependencies && NODE_OPTIONS=--max-old-space-size=14366 nx run-many --target=build --projects=@imtbl/sdk && yarn syncpack:format && yarn wsrun -p @imtbl/sdk -a -m copyBrowserBundles", "build:examples": "yarn workspaces foreach -Apt --include='@examples/**' run build", "build:onlysdk": "NODE_OPTIONS=--max-old-space-size=14366 nx run-many --target=build --projects=@imtbl/sdk && yarn syncpack:format", "dev": "./dev.sh",