Skip to content

Commit 3c7dc6d

Browse files
authored
Update stageBuild.yml
1 parent 70faf83 commit 3c7dc6d

File tree

1 file changed

+48
-26
lines changed

1 file changed

+48
-26
lines changed

.github/workflows/stageBuild.yml

Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,44 +23,66 @@ jobs:
2323

2424
- name: Clone depot_tools
2525
run: |
26-
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
27-
26+
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
27+
2828
- name: Add depot_tools to PATH
29-
run: |
30-
echo "${{ github.workspace }}/depot_tools" >> $GITHUB_PATH
29+
run: echo "${{ github.workspace }}/depot_tools" >> $GITHUB_PATH
30+
3131
- name: Fetch Chrome DevTools
3232
run: |
33-
export PATH="${{ github.workspace }}/depot_tools:$PATH"
34-
fetch devtools-frontend
35-
cd devtools-frontend
36-
gclient sync --with_branch_heads
33+
set -xe
34+
fetch devtools-frontend
35+
cd devtools-frontend
36+
gclient sync --with_branch_heads
37+
3738
- name: Setup Node.js
3839
uses: actions/setup-node@v3
3940
with:
40-
node-version: 14
41-
41+
node-version: 14
42+
4243
- name: Build Chrome DevTools
44+
working-directory: devtools-frontend
4345
run: |
44-
npm install
45-
npm run build
46+
set -xe
47+
npm config set loglevel verbose
48+
npm install
49+
npm run build
50+
51+
- name: Debug list devtools-frontend after build
4652
working-directory: devtools-frontend
47-
53+
run: |
54+
echo "Contents of devtools-frontend:"
55+
ls
56+
echo "Contents of out (if any):"
57+
ls -R out || echo "No out/ directory"
58+
4859
- name: Find DevTools build folder
4960
id: find_frontend_dir
61+
working-directory: devtools-frontend
5062
run: |
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
56-
echo "Detected frontend directory: $FRONTEND_DIR"
57-
echo "FRONTEND_DIR=$FRONTEND_DIR" >> $GITHUB_ENV
63+
set -e
64+
# Look for devtools_app.html under out/, usually in out/Default/gen/...
65+
FRONTEND_DIR=$(find out -type f -name "devtools_app.html" -print -quit | xargs -r dirname)
66+
67+
if [ -z "$FRONTEND_DIR" ]; then
68+
echo "Error: build folder not found!"
69+
ls -R out || echo "No out/ directory at all"
70+
exit 1
71+
fi
72+
73+
echo "Detected frontend directory (relative): $FRONTEND_DIR"
74+
75+
ABS_DIR="$PWD/$FRONTEND_DIR"
76+
echo "Detected frontend directory (absolute): $ABS_DIR"
77+
echo "FRONTEND_DIR=$ABS_DIR" >> $GITHUB_ENV
78+
5879
- name: Print versions
5980
run: |
60-
node -v
61-
npm -v
81+
node -v
82+
npm -v
83+
6284
- name: List built files
63-
run: ls -altr ${{ env.FRONTEND_DIR }}
85+
run: ls -altr "${{ env.FRONTEND_DIR }}"
6486

6587
- name: Configure AWS credentials
6688
uses: aws-actions/configure-aws-credentials@v2
@@ -73,11 +95,11 @@ jobs:
7395
run: |
7496
BUCKET=${{ env.STAGE_BUCKET }}
7597
echo "Uploading to S3 bucket: $BUCKET/${{ inputs.version }}"
76-
aws s3 sync "${{ env.FRONTEND_DIR }}" s3://$BUCKET/${{ inputs.version }}/ \
98+
aws s3 sync "${{ env.FRONTEND_DIR }}" "s3://$BUCKET/${{ inputs.version }}/" \
7799
--acl public-read --follow-symlinks --delete
78-
100+
79101
- name: Verify S3 Upload
80102
run: |
81103
BUCKET=${{ env.STAGE_BUCKET }}
82104
echo "Verifying S3 bucket: $BUCKET/${{ inputs.version }}"
83-
aws s3 ls s3://$BUCKET/${{ inputs.version }}/
105+
aws s3 ls "s3://$BUCKET/${{ inputs.version }}/"

0 commit comments

Comments
 (0)