From b039c4a1b1f70c0eb0c9c266870b7f5931ecb15e Mon Sep 17 00:00:00 2001 From: vaibhavLT Date: Mon, 24 Nov 2025 22:33:27 +0530 Subject: [PATCH 1/4] fix --- .github/workflows/stageBuild.yml | 70 +++++++++++++++++--------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/.github/workflows/stageBuild.yml b/.github/workflows/stageBuild.yml index 968e13cce9a..29cbeaf82f8 100644 --- a/.github/workflows/stageBuild.yml +++ b/.github/workflows/stageBuild.yml @@ -12,8 +12,7 @@ jobs: runs-on: ubuntu-latest env: - NODE_VERSION: 22 - S3_BUCKET: stage-falcon-component-v1 + STAGE_BUCKET: stage-falcon-component-v1 AWS_REGION: us-east-1 steps: @@ -21,62 +20,69 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - ref: stage - - name: Setup depot_tools + - name: Clone depot_tools run: | - git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git /tmp/depot_tools - echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH - echo "/tmp/depot_tools" >> $GITHUB_PATH - - - name: add depot_tools path to PATH + rm -rf depot_tools + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git + + - name: Add depot_tools to PATH run: | echo "${{ github.workspace }}/depot_tools" >> $GITHUB_PATH - + - name: Clone Chrome DevTools + run: | + rm -rf chromedev + git clone https://github.com/ChromeDevTools/devtools-frontend.git chromedev - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: ${{ env.NODE_VERSION }} - - - name: Sync dependencies + node-version: ${{ github.event.inputs.NODE_VERSION }} + + - name: Sync third-party dependencies run: | export PATH="${{ github.workspace }}/depot_tools:$PATH" - fetch devtools-frontend - cd devtools-frontend - gclient sync - + cd chromedev + gclient config https://github.com/ChromeDevTools/devtools-frontend.git + gclient sync --with_branch_heads - name: Build Chrome DevTools run: | npm install npm run build + working-directory: chromedev - name: Find DevTools build folder id: find_frontend_dir run: | - # Find the parent folder containing devtools_app.html - FRONTEND_DIR=$(find out -type f -name "devtools_app.html" -exec dirname {} \;) - echo "Detected frontend directory: $FRONTEND_DIR" - echo "FRONTEND_DIR=$FRONTEND_DIR" >> $GITHUB_ENV - + FRONTEND_DIR=$(find chromedev/out -type f -name "devtools_app.html" -exec dirname {} \;) + if [ -z "$FRONTEND_DIR" ]; then + echo "Error: build folder not found!" + exit 1 + fi + echo "Detected frontend directory: $FRONTEND_DIR" + echo "FRONTEND_DIR=$FRONTEND_DIR" >> $GITHUB_ENV - name: Print versions run: | node -v npm -v - - name: List built files run: ls -altr ${{ env.FRONTEND_DIR }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }} - aws-region: ${{ env.AWS_REGION }} + aws-access-key-id: ${{ github.event.inputs.DEPLOY_ENV == 'prod' && secrets.AWS_ACCESS_KEY_ID_PROD || secrets.AWS_ACCESS_KEY_ID_DEV }} + aws-secret-access-key: ${{ github.event.inputs.DEPLOY_ENV == 'prod' && secrets.AWS_SECRET_ACCESS_KEY_PROD || secrets.AWS_SECRET_ACCESS_KEY_DEV }} + aws-region: ${{ env.AWS_REGION }} - - name: Upload front_end folder to S3 + - name: Upload to S3 run: | - aws s3 sync ${{ env.FRONTEND_DIR }} s3://${{ env.S3_BUCKET }}/${{ inputs.version }}/ \ - --acl public-read --follow-symlinks --delete - - - name: Confirm S3 upload - run: aws s3 ls s3://${{ env.S3_BUCKET }}/${{ inputs.version }}/ \ No newline at end of file + BUCKET=${{ env.STAGE_BUCKET }} + echo "Uploading to S3 bucket: $BUCKET/${{ github.event.inputs.BUCKET_PATH }}" + aws s3 sync "${{ env.FRONTEND_DIR }}" s3://$BUCKET/${{ github.event.inputs.BUCKET_PATH }}/ \ + --acl public-read --follow-symlinks --delete + + - name: Verify S3 Upload + run: | + BUCKET=${{ env.STAGE_BUCKET }} + echo "Verifying S3 bucket: $BUCKET/${{ github.event.inputs.BUCKET_PATH }}" + aws s3 ls s3://$BUCKET/${{ github.event.inputs.BUCKET_PATH }}/ \ No newline at end of file From 433d0ec2a2a2c27a35fa8d8ad1ded6dcae2405ea Mon Sep 17 00:00:00 2001 From: vaibhavLT Date: Mon, 24 Nov 2025 22:34:23 +0530 Subject: [PATCH 2/4] fix --- .github/workflows/stageBuild.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stageBuild.yml b/.github/workflows/stageBuild.yml index 29cbeaf82f8..e5f53fc0394 100644 --- a/.github/workflows/stageBuild.yml +++ b/.github/workflows/stageBuild.yml @@ -70,8 +70,8 @@ jobs: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 with: - aws-access-key-id: ${{ github.event.inputs.DEPLOY_ENV == 'prod' && secrets.AWS_ACCESS_KEY_ID_PROD || secrets.AWS_ACCESS_KEY_ID_DEV }} - aws-secret-access-key: ${{ github.event.inputs.DEPLOY_ENV == 'prod' && secrets.AWS_SECRET_ACCESS_KEY_PROD || secrets.AWS_SECRET_ACCESS_KEY_DEV }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }} aws-region: ${{ env.AWS_REGION }} - name: Upload to S3 From 11ed267b69c4add8310820cecde44878486cbc6a Mon Sep 17 00:00:00 2001 From: vaibhavLT Date: Mon, 24 Nov 2025 22:37:31 +0530 Subject: [PATCH 3/4] fix: update S3 upload path in CI workflow to use version input --- .github/workflows/stageBuild.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/stageBuild.yml b/.github/workflows/stageBuild.yml index 516767f797c..5611f2d0b09 100644 --- a/.github/workflows/stageBuild.yml +++ b/.github/workflows/stageBuild.yml @@ -85,12 +85,12 @@ jobs: - name: Upload to S3 run: | BUCKET=${{ env.STAGE_BUCKET }} - echo "Uploading to S3 bucket: $BUCKET/${{ github.event.inputs.BUCKET_PATH }}" - aws s3 sync "${{ env.FRONTEND_DIR }}" s3://$BUCKET/${{ github.event.inputs.BUCKET_PATH }}/ \ + echo "Uploading to S3 bucket: $BUCKET/${{ inputs.version }}" + aws s3 sync "${{ env.FRONTEND_DIR }}" s3://$BUCKET/${{ inputs.version }}/ \ --acl public-read --follow-symlinks --delete - name: Verify S3 Upload run: | BUCKET=${{ env.STAGE_BUCKET }} - echo "Verifying S3 bucket: $BUCKET/${{ github.event.inputs.BUCKET_PATH }}" - aws s3 ls s3://$BUCKET/${{ github.event.inputs.BUCKET_PATH }}/ \ No newline at end of file + echo "Verifying S3 bucket: $BUCKET/${{ inputs.version }}" + aws s3 ls s3://$BUCKET/${{ inputs.version }}/ \ No newline at end of file From fba7a061a5cec8be2e9af13f044742065ce3316a Mon Sep 17 00:00:00 2001 From: vaibhavLT Date: Mon, 24 Nov 2025 22:46:50 +0530 Subject: [PATCH 4/4] fix --- .github/workflows/stageBuild.yml | 59 +++++++++++++------------------- 1 file changed, 23 insertions(+), 36 deletions(-) diff --git a/.github/workflows/stageBuild.yml b/.github/workflows/stageBuild.yml index 5611f2d0b09..00b8bcd5fe1 100644 --- a/.github/workflows/stageBuild.yml +++ b/.github/workflows/stageBuild.yml @@ -23,55 +23,42 @@ jobs: - name: Clone depot_tools run: | - rm -rf depot_tools - git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git - + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git + - name: Add depot_tools to PATH run: | - echo "${{ github.workspace }}/depot_tools" >> $GITHUB_PATH - - name: Clone Chrome DevTools + echo "${{ github.workspace }}/depot_tools" >> $GITHUB_PATH + - name: Fetch Chrome DevTools run: | - rm -rf chromedev - git clone https://github.com/ChromeDevTools/devtools-frontend.git chromedev + export PATH="${{ github.workspace }}/depot_tools:$PATH" + fetch devtools-frontend + cd devtools-frontend + gclient sync --with_branch_heads - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: ${{ github.event.inputs.NODE_VERSION }} - - - name: Sync third-party dependencies - run: | - export PATH="${{ github.workspace }}/depot_tools:$PATH" - cd chromedev - gclient config https://github.com/ChromeDevTools/devtools-frontend.git - gclient sync --with_branch_heads + node-version: ${{ github.event.inputs.NODE_VERSION }} + - name: Build Chrome DevTools run: | - export PATH="/tmp/depot_tools:$PATH" - # Ensure ninja is in PATH - if [ -d "devtools-frontend/third_party/ninja" ]; then - export PATH="$PWD/devtools-frontend/third_party/ninja:$PATH" - elif [ -d "third_party/ninja" ]; then - export PATH="$PWD/third_party/ninja:$PATH" - fi - cd devtools-frontend || cd . - npm install - npm run build - working-directory: chromedev - + npm install + npm run build + working-directory: devtools-frontend + - name: Find DevTools build folder id: find_frontend_dir run: | - FRONTEND_DIR=$(find chromedev/out -type f -name "devtools_app.html" -exec dirname {} \;) - if [ -z "$FRONTEND_DIR" ]; then - echo "Error: build folder not found!" - exit 1 - fi - echo "Detected frontend directory: $FRONTEND_DIR" - echo "FRONTEND_DIR=$FRONTEND_DIR" >> $GITHUB_ENV + FRONTEND_DIR=$(find devtools-frontend/out -type f -name "devtools_app.html" -exec dirname {} \;) + if [ -z "$FRONTEND_DIR" ]; then + echo "Error: build folder not found!" + exit 1 + fi + echo "Detected frontend directory: $FRONTEND_DIR" + echo "FRONTEND_DIR=$FRONTEND_DIR" >> $GITHUB_ENV - name: Print versions run: | - node -v - npm -v + node -v + npm -v - name: List built files run: ls -altr ${{ env.FRONTEND_DIR }}