@@ -12,107 +12,72 @@ jobs:
1212 runs-on : ubuntu-latest
1313
1414 env :
15- NODE_VERSION : 22
16- S3_BUCKET : stage-falcon-component-v1
15+ STAGE_BUCKET : stage-falcon-component-v1
1716 AWS_REGION : us-east-1
1817
1918 steps :
2019 - name : Checkout repository
2120 uses : actions/checkout@v3
2221 with :
2322 fetch-depth : 0
24- ref : stage
2523
26- - name : Setup depot_tools
24+ - name : Clone depot_tools
2725 run : |
28- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git /tmp/depot_tools
29- echo "/tmp/depot_tools" >> $GITHUB_PATH
30-
26+ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
27+
28+ - name : Add depot_tools to PATH
29+ run : |
30+ echo "${{ github.workspace }}/depot_tools" >> $GITHUB_PATH
31+ - name : Fetch Chrome DevTools
32+ run : |
33+ export PATH="${{ github.workspace }}/depot_tools:$PATH"
34+ fetch devtools-frontend
35+ cd devtools-frontend
36+ gclient sync --with_branch_heads
3137 - name : Setup Node.js
3238 uses : actions/setup-node@v3
3339 with :
34- node-version : ${{ env.NODE_VERSION }}
35-
36- - name : Create gclient config
37- run : |
38- cat > .gclient << 'EOF'
39- solutions = [
40- {
41- "managed": False,
42- "name": "devtools-frontend",
43- "url": "https://chromium.googlesource.com/devtools/devtools-frontend.git",
44- "custom_deps": {},
45- "deps_file": "DEPS",
46- "safesync_url": "",
47- },
48- ]
49- EOF
50-
51- - name : Sync dependencies
52- run : |
53- export PATH="/tmp/depot_tools:$PATH"
54- gclient sync
55- # Add ninja to PATH (check both possible locations)
56- if [ -d "devtools-frontend/third_party/ninja" ]; then
57- export PATH="$PWD/devtools-frontend/third_party/ninja:$PATH"
58- echo "$PWD/devtools-frontend/third_party/ninja" >> $GITHUB_PATH
59- elif [ -d "third_party/ninja" ]; then
60- export PATH="$PWD/third_party/ninja:$PATH"
61- echo "$PWD/third_party/ninja" >> $GITHUB_PATH
62- fi
63-
64- - name : Generate build files
65- run : |
66- export PATH="/tmp/depot_tools:$PATH"
67- # Ensure ninja is in PATH
68- if [ -d "devtools-frontend/third_party/ninja" ]; then
69- export PATH="$PWD/devtools-frontend/third_party/ninja:$PATH"
70- elif [ -d "third_party/ninja" ]; then
71- export PATH="$PWD/third_party/ninja:$PATH"
72- fi
73- cd devtools-frontend || cd .
74- gn gen out/Default
75-
40+ node-version : ${{ github.event.inputs.NODE_VERSION }}
41+
7642 - name : Build Chrome DevTools
7743 run : |
78- export PATH="/tmp/depot_tools:$PATH"
79- # Ensure ninja is in PATH
80- if [ -d "devtools-frontend/third_party/ninja" ]; then
81- export PATH="$PWD/devtools-frontend/third_party/ninja:$PATH"
82- elif [ -d "third_party/ninja" ]; then
83- export PATH="$PWD/third_party/ninja:$PATH"
84- fi
85- cd devtools-frontend || cd .
86- npm install
87- npm run build
88-
44+ npm install
45+ npm run build
46+ working-directory : devtools-frontend
47+
8948 - name : Find DevTools build folder
9049 id : find_frontend_dir
9150 run : |
92- # Find the parent folder containing devtools_app.html
93- FRONTEND_DIR=$(find out -type f -name "devtools_app.html" -exec dirname {} \;)
51+ FRONTEND_DIR=$(find devtools-frontend/out -type f -name "devtools_app.html" -exec dirname {} \;)
52+ if [ -z "$FRONTEND_DIR" ]; then
53+ echo "Error: build folder not found!"
54+ exit 1
55+ fi
9456 echo "Detected frontend directory: $FRONTEND_DIR"
9557 echo "FRONTEND_DIR=$FRONTEND_DIR" >> $GITHUB_ENV
96-
9758 - name : Print versions
9859 run : |
99- node -v
100- npm -v
101-
60+ node -v
61+ npm -v
10262 - name : List built files
10363 run : ls -altr ${{ env.FRONTEND_DIR }}
10464
10565 - name : Configure AWS credentials
10666 uses : aws-actions/configure-aws-credentials@v2
10767 with :
108- aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID_DEV }}
109- aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }}
110- aws-region : ${{ env.AWS_REGION }}
68+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID_DEV }}
69+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }}
70+ aws-region : ${{ env.AWS_REGION }}
11171
112- - name : Upload front_end folder to S3
72+ - name : Upload to S3
11373 run : |
114- aws s3 sync ${{ env.FRONTEND_DIR }} s3://${{ env.S3_BUCKET }}/${{ inputs.version }}/ \
115- --acl public-read --follow-symlinks --delete
116-
117- - name : Confirm S3 upload
118- run : aws s3 ls s3://${{ env.S3_BUCKET }}/${{ inputs.version }}/
74+ BUCKET=${{ env.STAGE_BUCKET }}
75+ echo "Uploading to S3 bucket: $BUCKET/${{ inputs.version }}"
76+ aws s3 sync "${{ env.FRONTEND_DIR }}" s3://$BUCKET/${{ inputs.version }}/ \
77+ --acl public-read --follow-symlinks --delete
78+
79+ - name : Verify S3 Upload
80+ run : |
81+ BUCKET=${{ env.STAGE_BUCKET }}
82+ echo "Verifying S3 bucket: $BUCKET/${{ inputs.version }}"
83+ aws s3 ls s3://$BUCKET/${{ inputs.version }}/
0 commit comments