From 1a7211b59f81b549154fb8294b2946dbf3e4412a Mon Sep 17 00:00:00 2001 From: Shine Li Date: Wed, 31 Jul 2024 12:19:55 +1000 Subject: [PATCH] fix: DX-3061 fix passport sample app deployment (#2040) --- .github/workflows/passport-sdk-sample-app-deployment.yaml | 6 +++--- packages/passport/sdk-sample-app/package.json | 2 +- .../passport/sdk-sample-app/scripts/updateSdkVersion.sh | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/passport-sdk-sample-app-deployment.yaml b/.github/workflows/passport-sdk-sample-app-deployment.yaml index e7d497bbf0..4c8db92d2c 100644 --- a/.github/workflows/passport-sdk-sample-app-deployment.yaml +++ b/.github/workflows/passport-sdk-sample-app-deployment.yaml @@ -33,12 +33,12 @@ jobs: - name: setup uses: ./.github/actions/setup - - name: Update SDK version - run: yarn workspace @imtbl/passport-sdk-sample-app update-sdk-version - - name: Export Passport sample app run: yarn nx run @imtbl/passport-sdk-sample-app:export + - name: Update SDK version + run: yarn workspace @imtbl/passport-sdk-sample-app update-sdk-version + - name: Upload to S3 run: | aws s3 sync ./packages/passport/sdk-sample-app/out s3://imx-passport-frontend-prod/sdk-sample-app diff --git a/packages/passport/sdk-sample-app/package.json b/packages/passport/sdk-sample-app/package.json index 4d5b710464..1032fa74e7 100644 --- a/packages/passport/sdk-sample-app/package.json +++ b/packages/passport/sdk-sample-app/package.json @@ -41,6 +41,6 @@ "export": "next export", "lint": "eslint ./src --ext .ts --max-warnings=0", "start": "next start", - "update-sdk-version": "scripts/updateSdkVersion.sh ../../internal/generated-clients/src/config/config.ts" + "update-sdk-version": "scripts/updateSdkVersion.sh ./out" } } diff --git a/packages/passport/sdk-sample-app/scripts/updateSdkVersion.sh b/packages/passport/sdk-sample-app/scripts/updateSdkVersion.sh index 60ff9061b0..c1dddee49e 100755 --- a/packages/passport/sdk-sample-app/scripts/updateSdkVersion.sh +++ b/packages/passport/sdk-sample-app/scripts/updateSdkVersion.sh @@ -1,5 +1,7 @@ +#!/bin/bash + if [[ "$OSTYPE" == "darwin"* ]]; then -sed -i '' "s/__SDK_VERSION__/$(git describe --tags --abbrev=0)/g" $1 +find $1 -type f -name "*.js" -exec sed -i '' "s/__SDK_VERISON__/$(git describe --tags --abbrev=0)/g" {} +; else -sed -i "s/__SDK_VERSION__/$(git describe --tags --abbrev=0)/g" $1 +find $1 -type f -name "*.js" -exec sed -i "s/__SDK_VERISON__/$(git describe --tags --abbrev=0)/g" {} +; fi